Hey Guys!!
I am trying to update an access table using the RunSql function in access. I want to be able to update a single column each time with the ID# on the current form. Here is my code:
Dim NEWID As Integer
NEWID = Me.UniqueKey.Value (also tried without .value)
DoCmd.RunSQL "Update ID set Key = NEWID where UID = 1"
DoCmd.RunMacro "Export"
This is to printout the current form to a file, but the thing is that when I run it, Access wants to knowthe value for NEWID, and I thought I already set it. I think it's because Variables aren't applicable in an SQL statement, but I was wondering if anyone has suggestions on how I can do this. THANX GUYS!!!!
I am trying to update an access table using the RunSql function in access. I want to be able to update a single column each time with the ID# on the current form. Here is my code:
Dim NEWID As Integer
NEWID = Me.UniqueKey.Value (also tried without .value)
DoCmd.RunSQL "Update ID set Key = NEWID where UID = 1"
DoCmd.RunMacro "Export"
This is to printout the current form to a file, but the thing is that when I run it, Access wants to knowthe value for NEWID, and I thought I already set it. I think it's because Variables aren't applicable in an SQL statement, but I was wondering if anyone has suggestions on how I can do this. THANX GUYS!!!!