Thank you! Thats what i need. But i have an issue now whereby when i want to my record in the form based on the selected category it shows the ID number instead of the product category. How do i make my code read the product category instead of the ID number?
For instance:
The code only read cbopcat as the ID, instead of apple
Code:
Dim sSQL As String
'Insert into banana
If Me.cbopcat = "Banana" Then
sSQL = "Insert into [Banana] (ReceivedDate,ProductCategory,ProductDescription,ReceivedQuantity,[Currency],UnitPrice,TotalAmount,Remarks) " & _
"Values ('" & Me.txtrcvdate & "','" & Me.cbopcat & "','" & Me.txtpdes & "','" & Me.txtrcvquantity & "','" & Me.txtcurrency & "','" & Me.txtunitprice & "','" & Me.txtttlamount & "','" & Me.txtremarks & "')"
'Insert into Apple
ElseIf Me.cbopcat = "Apple" Then
sSQL = "Insert into [Apple] (ReceivedDate,ProductCategory,ProductDescription,ReceivedQuantity,[Currency],UnitPrice,TotalAmount,Remarks) " & _
"Values ('" & Me.txtrcvdate & "','" & Me.cbopcat & "','" & Me.txtpdes & "','" & Me.txtrcvquantity & "','" & Me.txtcurrency & "','" & Me.txtunitprice & "','" & Me.txtttlamount & "','" & Me.txtremarks & "')"
end if