By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,461 Members | 2,184 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,461 IT Pros & Developers. It's quick & easy.

Run-time error 3075 using DLookUp

P: 13
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Text9.value = DLookup("oleku_nimi", "[Arvete olekud]", "oleku_id= " & Me.oleku_id)
  3. End Sub
  4.  
This should fill a field on a subform. When I run just the subform then it works fine. But when I run it from the main form then it gives me run-time error 3075 pointing to 'oleku_id= ' saying that it is missing an operator. I already tried referencing the Me.oleku_id differently: "Forms!main_form!Subform.form!oleku_id". Didn't work either.
May 1 '12 #1
Share this Question
Share on Google+
2 Replies


Rabbit
Expert Mod 10K+
P: 12,355
The correct reference is
Forms!formName!subformControlName.Form!controlName
May 1 '12 #2

NeoPa
Expert Mod 15k+
P: 31,398
I'm not sure the dot (.) is handled in a SQL reference, but Forms!formName.subformControlName.Form.controlName can also, quite correctly, be written as Forms!formName!subformControlName!controlName as the default property for a SubForm is .Form.
May 1 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.