Hi Folks,
I am a newbie to ACCESS . And i am stuck with inserting values of combobox directly into a record in table.
I have five different tables(each has only one cloumn) and a complete full_details table(contains 5 cloumns).I have a simple form with five comoboxes and a save button on it. The five comboboxes are populated from five different comboxes at the time of form load. Now, I want to add values selected from these comboxes in fulll_details table.
My form is unbound.
I tried with VBA code ,
on the save button click,
I have written ,
Private Sub save_Click()
CurrentDb.Execute "Insert into Full_Details(Col1,col2,col3,col4,col5) Values ('" & Combo0 & "','" & Combo1 & "','" & Combo2 & "','" & Combo3 & "','" & Combo4 & "');"
MsgBox "Record Saved !!!", vbInformation, "Success"
End Sub
It gives me some error :banghead::banghead::banghead::banghead:
"You can't reference a property or method for a control unless the control has the focus property set"
Ahhh...now this has got on my nerves...
See, above query works fine ,if i set focus of one combobox,but it adds only 1 combobox value in full_details table as only 1 column value.
Please help asap. This forum has helped me a lot. Finally, i have registered myself today.
Hoping to get help from you all experts in ACCESS.
I am a newbie to ACCESS . And i am stuck with inserting values of combobox directly into a record in table.
I have five different tables(each has only one cloumn) and a complete full_details table(contains 5 cloumns).I have a simple form with five comoboxes and a save button on it. The five comboboxes are populated from five different comboxes at the time of form load. Now, I want to add values selected from these comboxes in fulll_details table.
My form is unbound.
I tried with VBA code ,
on the save button click,
I have written ,
Private Sub save_Click()
CurrentDb.Execute "Insert into Full_Details(Col1,col2,col3,col4,col5) Values ('" & Combo0 & "','" & Combo1 & "','" & Combo2 & "','" & Combo3 & "','" & Combo4 & "');"
MsgBox "Record Saved !!!", vbInformation, "Success"
End Sub
It gives me some error :banghead::banghead::banghead::banghead:
"You can't reference a property or method for a control unless the control has the focus property set"
Ahhh...now this has got on my nerves...
See, above query works fine ,if i set focus of one combobox,but it adds only 1 combobox value in full_details table as only 1 column value.
Please help asap. This forum has helped me a lot. Finally, i have registered myself today.
Hoping to get help from you all experts in ACCESS.