Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2007 - passing function variable to query wihtout using VBA

Status
Not open for further replies.

UnsolvedCoding

Technical User
Jul 20, 2011
424
US
I have a problem (again).

A table was made for a time sheet that houses employees last and first names with an employee number. Because those three fields need to be combined a select query was made which correctly populates the information - the field is called Emp_ID.

When the form that uses Emp_ID populates the combobox everything is correctly.

So far so good.

The queries that need to run follow the do.cmd statment in VBA but as soon as the VBA starts to use the SQL update statment the variables given in functions do not pass back to the table in Access and Access asks for the value of the Emp_ID field.

I need to fix this and the expression builder has a way to get into functions but nothing I have found for code samples or articles has fixed the problem of why the fields work and then go blank and why the table won't populate like it did a few hours ago.

This is driving me in circles.
 
I'm not sure I understand... do you have a field in a table that should be populated with the concatenation of LastName, FirstName, and EmpNumber?
Is this what you are trying to do?

--Lilliabeth
 
I have a query that contactenates the last name, first name and employee number into a string for a combobox in a form. However, the query is not retaining that information if I try to use it in SQL that is written in a VBA sub. It will run in the previous two do.cmds but not in the update statment in the same sub.

I checked the text and it matches between the queries and the SQL text.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top