tempvar/combo box error

markdooler

Member
Local time
Today, 17:23
Joined
Nov 25, 2020
Messages
58
Hi All

Me again.

So todays issue is around why i cant get the bloomin cobo box to work

So, i have a table with a list of users for various sites (tblUsers)

I have a tempvar set to a specific site.

I have a query on the tblUsers that uses the tempvar to filter a list of users just for that site (qryCurrentSiteUsers)

This query does exactly what it should and work fine as a query.

I am trying to use that query to populate a combo box

I am getting the below error.

I have created a million combo boxes of this nature but this is the first time i have used a query that is using a tempvar

Any ideas?

1611152758743.png
 
I hate TempVars there are some many easier ways than tempVers post the code behind the combo
 
Hi. How are you initializing the TempVar?
 
Hi. How are you initializing the TempVar?
The user logs on and there is VBA code that sets 2 TempVars. One for the site they work at, the other is their username.

The idea was to use these to filter date relevant to them/their site

The tempvars then stay active untill the application is closed and someone else logs on.
 
The user logs on and there is VBA code that sets 2 TempVars. One for the site they work at, the other is their username.

The idea was to use these to filter date relevant to them/their site

The tempvars then stay active untill the application is closed and someone else logs on.
Seeing the actual VBA would help with troubleshooting. If a TempVar exists but not initialized, it should return a Null value. Otherwise, you would get a prompt. Another possibility is the name of the TempVar in the query does not match the one in VBA.
 
Hi. How are you initializing the TempVar?
I would hazards a guess as similar as shown for the criteria?

That is how I tend to initialise mine. Never used the .Add method?

Code:
    TempVars("EmployeeID").Value = Me.cboEmployeeID.Column(0)
    TempVars("Employee").Value = Me.cboEmployeeID.Column(1)
    TempVars("UserLevel").Value = DLookup("DataOrder", "tblLookup", "LookupID = " & Me.cboEmployeeID.Column(3))
 
I would hazards a guess as similar as shown for the criteria?

That is how I tend to initialise mine. Never used the .Add method?

Code:
    TempVars("EmployeeID").Value = Me.cboEmployeeID.Column(0)
    TempVars("Employee").Value = Me.cboEmployeeID.Column(1)
    TempVars("UserLevel").Value = DLookup("DataOrder", "tblLookup", "LookupID = " & Me.cboEmployeeID.Column(3))
That may be the case, but TempVars are initialized using VBA, not with queries. So, I was just curious to see what that VBA code looked like. It might show us a misspelling or something. That's all.
 

Users who are viewing this thread

Back
Top Bottom