I'd like to use code to search for an existing record in field called "Partnum" and then use things like update delete or add new. I'd really like to use that field as the primary key, but it's not a necessity.
So far I'm only able to get dbs.EXECUTE "INSERT INTO....."
to work for me.
I have a search function that populates text boxes on my forms that works fine, but I just can't seem to figure out how to do the above as a before update procedure.
Can anyone point me to some help?
The code below is what I'm using to commit changes and I'd prefer not to create new records if I can update them instead.
TIA
Tim G
If Y = "Mori Seiki SL-35" Then
dbs.Execute "INSERT INTO MoriSeikiHub (Partnum,BilletL,BodyL,OAL,BilletD,FlangeD,BodyD,BoreD,Hole,ODcut,ODfeed,IDcut,IDfeed,Speed,Machine,Material,Volume,Timeof) Values " _
& "(('" & txtPN & "'), ('" & Text1 & "'),('" & Text2 & "'), ('" & Text3 & "'), ('" & Text4 & "'), ('" & Text5 & "'), " _
& "('" & Text6 & "'), ('" & Text7 & "'), ('" & Text8 & "'), ('" & ComboODcut & "'), ('" & ComboODfeed & "'), ('" & ComboIDcut & "'), ('" & ComboIDfeed & "'), " _
& "('" & Combospeed & "'), ('" & lblmachine & "'), ('" & lblmaterial & "'), ('" & Text9 & "'), ('" & Text10 & "')) "
ElseIf etc. below this.
So far I'm only able to get dbs.EXECUTE "INSERT INTO....."
to work for me.
I have a search function that populates text boxes on my forms that works fine, but I just can't seem to figure out how to do the above as a before update procedure.
Can anyone point me to some help?
The code below is what I'm using to commit changes and I'd prefer not to create new records if I can update them instead.
TIA
Tim G
If Y = "Mori Seiki SL-35" Then
dbs.Execute "INSERT INTO MoriSeikiHub (Partnum,BilletL,BodyL,OAL,BilletD,FlangeD,BodyD,BoreD,Hole,ODcut,ODfeed,IDcut,IDfeed,Speed,Machine,Material,Volume,Timeof) Values " _
& "(('" & txtPN & "'), ('" & Text1 & "'),('" & Text2 & "'), ('" & Text3 & "'), ('" & Text4 & "'), ('" & Text5 & "'), " _
& "('" & Text6 & "'), ('" & Text7 & "'), ('" & Text8 & "'), ('" & ComboODcut & "'), ('" & ComboODfeed & "'), ('" & ComboIDcut & "'), ('" & ComboIDfeed & "'), " _
& "('" & Combospeed & "'), ('" & lblmachine & "'), ('" & lblmaterial & "'), ('" & Text9 & "'), ('" & Text10 & "')) "
ElseIf etc. below this.