I'm creating a program which, in one functional requirement, asks the user to enter a number, say n, into a form. This number will be used to append 'n' records to an existing table, where the primary keys are JobID and RowID (being {1,2,...,n}). JID is computed as the concatenation of date, time, and a text string (currently " - 001" but will later be replaced by the username).
I tried a 'For count = 1 to RID / Next' loop, and when that didn't work, I went down to trying to just inserting a single row using the following (which is also not working):
Public Function JID() As String
JID = Date & " " & Time() & " - 001"
End Function
Public Sub Command6_Click()
Dim tempSQL As String
tempSQL = "INSERT INTO [tbl Job Temp] (JobID) SELECT "
tempSQL = tempSQL & JID
tempSQL = tempSQL & " As JobID"
DoCmd.RunSQL tempSQL
End Sub
Can anyone help? Thanks!
::Bryan
PS - in the underlying table, JobID is a "Text" field.
I tried a 'For count = 1 to RID / Next' loop, and when that didn't work, I went down to trying to just inserting a single row using the following (which is also not working):
Public Function JID() As String
JID = Date & " " & Time() & " - 001"
End Function
Public Sub Command6_Click()
Dim tempSQL As String
tempSQL = "INSERT INTO [tbl Job Temp] (JobID) SELECT "
tempSQL = tempSQL & JID
tempSQL = tempSQL & " As JobID"
DoCmd.RunSQL tempSQL
End Sub
Can anyone help? Thanks!
::Bryan
PS - in the underlying table, JobID is a "Text" field.