Master table bound to master form
i created a combo box and changed the control source to vendor( which is field name in the master table)
so i have new record button Macro which takes all the data from the combo box also and when pressed save button it saves into master table.
but when i open the form it shows all records one by one and when pressed next button it shows second record. typically its a huge form.( this is in view stage)
Task i want to update the value selected in the combo box into the table but it throws me this error that the value you entered is not valid for the Field 'ID'
but i tried my best it is pointing the ID of the vendor table.
Also code you asked looks for onchange combox is
Dim vendor As Variant
Dim strRQL As String
Dim str2 As Integer
Dim num As Integer
num = DCount("*", "Master")
If (Form_Master.ID <= num) Then
vendor = DLookup("vendor_name", "vendortable", "ID=" & Combo683.Value & "")
Set dbs = CurrentDb()
str2 = Form_Master.ID
strRQL = "Update Master set vendor="
strRQL = strRQL & " '" & vendor & "' WHERE ID=" & str2 & ";"
CurrentDb.Execute strRQL
dbs.Close
That error is poped when the the lines of code is executed but as soon as when i press the next button its shows that error. but my update was made into the table still shows the error i wonder why
Also if i click the refresh all button which is on top then the error doesn't pop weird