Hi
Try the following in the on click event for your button...
Dim SQLString as String
SQLString = "insert into tblJobs (JobNumber, OtherField1, OtherField2) " & _
"select '" & Me.JobNumberTo & "', " & _
"OtherField1, OtherField2 from tblJobs " & _
"where QtyKitted > 0 and JobNumber = '" & Me.JobNumberFrom & "'"
DoCmd.RunSQL
Obviously, use your own table name and field names. I didn't know what other
fields you were copying from 1 job to another (if any) so have written the
above to use 2 more as an example. I have also assumed your form has 2
textboxes named JobNumberFrom and JobNumberTo for the user to enter the job
numbers.
Regards
Andy Hull
> Hi All,
> Imagine...you have the database with the following form:-
[quoted text clipped - 15 lines]
>
> Note : If you need a database, do tell me....
EMILYTAN - 31 May 2007 08:14 GMT
Hi Andy,
But I think this line got a bit error (or perhaps I figure wrongly)
"select"" & Me.txtJobNumberNew&"", "&_
because I want to get the value from the "Me.txtJobNumberNew" to be inserted
to the JobNumber field
Code:
------------------------------------------------------------------------------
--
Private Sub cmdInsertItem_Click()
Dim SQLString As String
SQLString = "insert into WIPRawDetails (JobNumber, PartNumber) " & _
"select '" & Me.txtJobNumberNew & "', " & _
"PartNumber from WIPRawDetails " & _
"where W_KittedQty > 0 and JobNumber = '" & Me.txtJobNumberOld & "'"
'DoCmd.RunSQL
End Sub
------------------------------------------------------------------------------
--
Well, if it is correct, how come it didnt show me any response, not even
error message...
>Hi
>
[quoted text clipped - 23 lines]
>>
>> Note : If you need a database, do tell me....
EMILYTAN - 01 Jun 2007 01:28 GMT
Hi Andy,
I can figure it out already...Thanks a lot
>Hi
>
[quoted text clipped - 23 lines]
>>
>> Note : If you need a database, do tell me....