Passing TempVar value into a table

jonnyboy101

Registered User.
Local time
Today, 10:17
Joined
Dec 4, 2013
Messages
15
Hi All,

I have a form in which the user selects a combobox and this value becomes a tempvar called "un" on clicking a command button I need the value of "un" to be passed into a table.

"un" is a number.

Here is what I have so far.....

Code:
        CurrentDb.Execute "INSERT INTO timedata(startedby) " & _
        " VALUES(" & TempVars!un & ")"

but seem to get syntax errors all the time. Hope someone can help. Jon
 
Humor me, why is the field unbound if you're trying to store it in a table?
 
Because the user needs.to select their name and then another macro runs, then their name is passed to the table. Make sense?
 
What about, (I suppose timedata is the table name and startedby is the field name with the data type number and un is a variable name):
Code:
CurrentDb.Execute "INSERT INTO timedata (startedby) " & _ 
" VALUES(" & un & ")"
 
You're welcome, luck with your project.
 

Users who are viewing this thread

Back
Top Bottom