Thank you for your help,
I am trying to update records in a table with the update statement, By using a unbound Listbox [SN] that shows serial#(s) (stored as text) (able to select Multi) primary key is hiding, there is a third column that shows item discerption (text), then there is a unbound Combobox [Loc] (stored as text, primary key hiding) that shows locations. Both are located on table [Master].
The user will select one or many SN’s then select the location that they will be stored and hit the submit button.
[Master] – is the table
[Loc] – is the field saved as text, field to be updated with what is selected in [ToLocSlct]
[SNSlctToLoc] – Listbox saved as text, multi select listing serial #’s, will select the records that needs to be updated
[ToLocSlct] – Combobox saved as text, listing locations
Below are all the ways I have tried and I am missing something or in the wrong place. Please help and describe what I did wrong so that I can learn what I am doing wrong.
Any suggestion will be helpful, and thank you again
I am trying to update records in a table with the update statement, By using a unbound Listbox [SN] that shows serial#(s) (stored as text) (able to select Multi) primary key is hiding, there is a third column that shows item discerption (text), then there is a unbound Combobox [Loc] (stored as text, primary key hiding) that shows locations. Both are located on table [Master].
The user will select one or many SN’s then select the location that they will be stored and hit the submit button.
[Master] – is the table
[Loc] – is the field saved as text, field to be updated with what is selected in [ToLocSlct]
[SNSlctToLoc] – Listbox saved as text, multi select listing serial #’s, will select the records that needs to be updated
[ToLocSlct] – Combobox saved as text, listing locations
Below are all the ways I have tried and I am missing something or in the wrong place. Please help and describe what I did wrong so that I can learn what I am doing wrong.
Any suggestion will be helpful, and thank you again
Code:
[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]CurrentDb.Execute "UPDATE [Master] SET [Loc] = [ToLocSlct] WHERE [SN] '" = Me.SNSlctToLoc.itemselected & "'"[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]CurrentDb.Execute "UPDATE [Master] SET [Loc] = ToTLocSlct.Value WHERE [SN] = '" & Me.SNSlctToLoc.Column() & "'"[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]CurrentDb.Execute "UPDATE [Master] SET [Loc]='" & (Me.SNSlctToLoc.Column()) & "'"[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]CurrentDb.Execute "UPDATE [Master] SET [Loc]='" & Me.SNSlctToLoc.Column().Value & "'"[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]CurrentDb.Execute "UPDATE [Master] SET [Loc] = ToTLocSlct " WHERE [SN] = & Me.SNSlctToLoc[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]CurrentDb.Execute "UPDATE Master SET Loc = ToTLocSlct " & "WHERE SN = Me.SNSlctToLoc.Value"[/FONT][/SIZE]
[FONT=Calibri][SIZE=3]CurrentDb.Execute "UPDATE [Master] SET [Loc]= ToTLocSlct " & "WHERE [SN] = Me.SNSlctToLoc.Value"[/SIZE][/FONT]