noobaccess
Registered User.
- Local time
- Today, 15:34
- Joined
- Nov 20, 2012
- Messages
- 32
Hi, i need help!
i am trying to insert multiple values that i have selected in my listbox to my database access table when i click the "add record button" but the values does not appear in my database table.
i have 2 listbox, when i select the first list box(businessNature) it will display the records in the 2nd list box(lstCuisine). However, the records in the the lstCuisine list box is not entered into the table in my database.
(ps: in my property sheet for my lstCuisine listbox its multi select is simple)
Here is my codes:
Private Sub Add_Record_Click()
If IsNull(Name) = True Or IsNull(Mobile) = True Or IsNull(Email) = True Or IsNull(CompanyName) = True Or IsNull(BusinessNature) = True Then
MsgBox "Please fill in Business Nature, Name, Contact, Email and Company Name"
Else
DoCmd.GoToRecord , , acNewRec
End If
Dim conceptValue As String
Dim strInsert As String
Dim i As Long
For i = 0 To lstCuisine.ListCount - 1
If lstCuisine.Selected(i) = True Then
conceptValue = conceptValue & lstCuisine.Column(0, i)
End If
Next i
strInsert = "INSERT INTO ProspectsTable(Concept)" & "VALUES(conceptValue);"
DoCmd.RunSQL strInsert
DoCmd.GoToRecord , , acNewRec
End Sub
Please help!!!!!!!! i need to know how to work this asap!
Thanks in advance!
i am trying to insert multiple values that i have selected in my listbox to my database access table when i click the "add record button" but the values does not appear in my database table.
i have 2 listbox, when i select the first list box(businessNature) it will display the records in the 2nd list box(lstCuisine). However, the records in the the lstCuisine list box is not entered into the table in my database.
(ps: in my property sheet for my lstCuisine listbox its multi select is simple)
Here is my codes:
Private Sub Add_Record_Click()
If IsNull(Name) = True Or IsNull(Mobile) = True Or IsNull(Email) = True Or IsNull(CompanyName) = True Or IsNull(BusinessNature) = True Then
MsgBox "Please fill in Business Nature, Name, Contact, Email and Company Name"
Else
DoCmd.GoToRecord , , acNewRec
End If
Dim conceptValue As String
Dim strInsert As String
Dim i As Long
For i = 0 To lstCuisine.ListCount - 1
If lstCuisine.Selected(i) = True Then
conceptValue = conceptValue & lstCuisine.Column(0, i)
End If
Next i
strInsert = "INSERT INTO ProspectsTable(Concept)" & "VALUES(conceptValue);"
DoCmd.RunSQL strInsert
DoCmd.GoToRecord , , acNewRec
End Sub
Please help!!!!!!!! i need to know how to work this asap!
Thanks in advance!
