So I have a lookup on a form that is searching for the Customer based on the following Embedded Macro
It's pulling on the following data:
SELECT qry_cxLookup.Cu stID, qry_cxLookup.Co mpany FROM qry_cxLookup ORDER BY qry_cxLookup.Co mpany;
The main form is using the same query, but is only displaying the record that matches an unbound text box on my main form.
I added this to eliminate the form displaying the first record from table when it loads. The goal is to display the chosen company info only (fields are locked and disabled).
So here is my problem, well problems, and (as usual) I'm positive I am making it more complicated than it has to be.
Any help will be greeted with cheers and a big thank you!
Code:
="SearchForRecord ObjectType Object Name Record First Where Condition = [CustID] = " & Str(Nz([Screen].[ActiveControl],0))
SELECT qry_cxLookup.Cu stID, qry_cxLookup.Co mpany FROM qry_cxLookup ORDER BY qry_cxLookup.Co mpany;
The main form is using the same query, but is only displaying the record that matches an unbound text box on my main form.
Code:
txtCustID=[cmb_CxLookup].[Column](0)
So here is my problem, well problems, and (as usual) I'm positive I am making it more complicated than it has to be.
- I hate Macros for reason 2 and would love to convert this code to VBA (but the option is not available on the macro page)
- I can't figure out how on the AfterUpdate macro, to get the form to Requery/Refresh to update and display the records, which it does perfectly when I update manually.
- I need to either know how to hide the first company from displaying until the record is selected OR
- I need to be able to set the value from txtCustID to CustID AfterUpdate so that the company data displays automatically.
Any help will be greeted with cheers and a big thank you!
Comment