CurrentDb.Execute "Update YourTable " & _
"Set SomeField = '" & Me.YourTextBox & "' " & _
"Where SomeOtherField = 'SomeValue'"
Update [B]Salary[/B]
Set [B]HourlyRate [/B]= 50.0
Where [B]Programmer [/B]= 'Jones'
CurrentDb.Execute "Update Beställda-Produkter " & _
"Set Enhetspris = '" & Me.Text45 & "' " & _
"Where Produkt nummer = '" & text51.Value & "';"
CurrentDb.Execute "Update Beställda-Produkter " & _
"Set Enhetspris = '" & Me.Text45 & "' " & _
"Where [B][SIZE="3"][[/SIZE][/B]Produkt nummer[B][SIZE="3"]][/SIZE][/B] = '" & text51.Value & "';"
Try changing your code as followsI know that I have to change the name table and the on the code but still not working. I have attached a picture showing my table.
When I press the button on my form, lets say the Text51.Value = 7240, then on my table field, "Enhetspris" a value that Text45 have should be added in the "Enhetspris" where "Produktnummer" is 7240
button code:
CurrentDb.Execute "Update Beställda-Produkter" & _
"Set Enhetspris = '" & Text45.Value & "' " & _
"Where Produktnummer = '" & Text51.Value & "';"
thanks for all help Wayne
xxd
button code:
dim strQuery as String
strQuery = "Update Beställda-Produkter " & _
"Set Enhetspris = '" & Text45.Value & "' " & _
" Where Produktnummer = '" & Text51.Value & "';"
debug.print strQuery
CurrentDb.Execute strQuery
Then there is something wrong with strQuery. What was the diagnostic printout of strQuery. You need to give us all the relevant information if you want us to help youerror on:
CurrentDb.Execute strQuery