dLookup Compile Error (1 Viewer)

Sinfathisar

Registered User.
Local time
Today, 15:12
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.
 

Sinfathisar

Registered User.
Local time
Today, 15:12
Joined
Jan 29, 2009
Messages
60
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.
 

burrina

Registered User.
Local time
Today, 14:12
Joined
May 10, 2014
Messages
972
Are you sure your name controls match the criteria?
 

Sinfathisar

Registered User.
Local time
Today, 15:12
Joined
Jan 29, 2009
Messages
60
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?
 

GinaWhipp

AWF VIP
Local time
Today, 15:12
Joined
Jun 21, 2011
Messages
5,899
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*?
 

Sinfathisar

Registered User.
Local time
Today, 15:12
Joined
Jan 29, 2009
Messages
60
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.
 

burrina

Registered User.
Local time
Today, 14:12
Joined
May 10, 2014
Messages
972
Glad you are getting it sorted out. Keep Debugging!

Good Luck With Your Project . . .
 

GinaWhipp

AWF VIP
Local time
Today, 15:12
Joined
Jun 21, 2011
Messages
5,899
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

Top Bottom