dLookup Compile Error

Sinfathisar

Registered User.
Local time
Today, 15:55
Joined
Jan 29, 2009
Messages
60
Can anyone help me understand why I am getting "Compile Error: Expected: =" here:

Code:
 Private Sub Form_Load()
  
 Me.Text9 = DLookup("[Along_line_spacing]", "Performance_Requirements_Defaults_Table")
when this:

Code:
 Private Sub Form_Load()
  
 Me.charttypestatic = DLookup("[Static_Chart_Type]", "Project_Defaults")
works???


The "Performance_Requirements_Defaults_Table" table is linked, the "Project_Defaults" table is not.
 
So maybe it is normal to get the compile error? I get the same thing when running on the code that works, but still can't figure out why the other does not work.
 
Are you sure your name controls match the criteria?
 
Yeah I double and triple checked them. I also played around with the code a little. If Both tables are linked it works, if none are linked it works, but if one is linked and the other is not, they do not work. Is there a way to refer more specifically to the tables being used in this instance?
 
Please explain what you mean by linked. Are you saying your database is split? Is *Project_Defaults* a table or query and does in include *Performance_Requirements_Defaults_Table*?
 
Project_Defaults and Performance_Requirements_Defaults_Table are two separate tables. My database is split, with most of the tables in a linked BE. There are a few that reside in the interface, including Project_Defaults.

I just created a new test form and added lookups one each from a linked table in the BE and one from a table in the interface and it worked fine, so I am thinking either form corruption, or some of my other form code is interfering with the lookup functioning properly.
 
Glad you are getting it sorted out. Keep Debugging!

Good Luck With Your Project . . .
 
Okay, then it looks like all is well in world, till next time (hoping there never is a next time)... :D
 

Users who are viewing this thread

Back
Top Bottom