I amd doing something that returns this error
" Run time error 3075 Syntax error (missing operator) in query CustomerID= ."
VBA Dlookup up error
Access beginner (yes I am an Access Dummy )
VBA very very Green hand cut and paste only
I am attempting to use dlookup for the first time. I have followed an example from an online tutorial [ which I suspect was published with access 2003 ] its here http://599cd.com/tips/access/dlookup-function/?key=AllExperts
please realise that I do not understand yet the term " control " or "bound " I understand look up column as that is what I use regularly
Why am I using dlookup up? because in many situations I have found that I want to bring more than one column into a table when I use a look up column i.e. if I use a lookup to pick company to go in the incident table why cant it bring its buddies along too .. Address and post code?? I have been assured by Access Experts that.. As with nearly EVERYtiNg that you want to do in access to achieve something..." OH NOO LAD you cant do that !! NOT unless you use VBA " so HERE i am trying VERY HARD to do something very simple and use vba to help the job along
My need is to get address field populated in a form based on an incident table when I look up company from the customers table if I can learn to do that then surely I can progress to doing it somewhere real and useful
Situation: - I have two tables customers and incident (these are example tables only to try to get the dlookup to work before I apply it to real situation
The company column in the incident table is a lookup column that gives me a drop down where I pick the company name to populate company in the incident tbl /form . in a vague kind of way I am aware that company is tied to the customer ID so that is what is actually being picked just what the implications are for that arr in the wide world of vba I am clueless
1 created the form Incident 2 clicked on design mode 3 clicked on the company field 4open the properties sheet and in 5 the event tab on the line after update 6 clicked on the ... button chosen code builder and then 7 pasted in the line of code where the tutorial seemed to indicate & saved & closed
8 Returned to the from ,9into from view and 101 entered a row of data using the company drop down and then I get the error message when I click on for a new record
I have attached the file of the data base
I suspect that in my haste to learn and get some work done I have in my gross ignorance missed a trick somewhere
Your help would be appreciated in shedding light on what the trick is that dumbo has missed.
If I can get this to work ,this will give me a momentary feeling of elation that might help me to continue using this infuriating, antagonising software a for another day !!
Option Compare Database
Private Sub Company_AfterUpda()
Private Sub Company_AfterUpdate()
Address = DLookup("[Address]", "[CustomersTbl]", "[CustomerID] = " & CustomerID)