Hi i am struct with following additional version of my code.
I am trying to call first 3 fields of table upon after update event of combobox on my form, but it gives me error i think i am missing some quotation marks around the reference in below code or may be more.
I wanted these three unbound text boxes act accordance to the table i have referenced in above code to enter the new entries (Last row) on each table for these table fields only.
Many thanks in advance for your help.
I am trying to call first 3 fields of table upon after update event of combobox on my form, but it gives me error i think i am missing some quotation marks around the reference in below code or may be more.
Code:
Private Sub CboOptions_AfterUpdate()
If Me.CboOptions.Value = "Employee" Then
Me.tblDataSheet.SourceObject = "table.tblEmployees"
Me.textbox_1.Value = "tblEmployees","EmpID"
Me.Textbox_2.Value = "tblEmployees","Fullname"
Me.Textbox_3.Value = "tblEmployees","Surname"
ElseIf Me.CboOptions.Value = "Contact" Then
Me.tblDataSheet.SourceObject = "table.tblContacts"
Me.textbox_1.Value = "tblEmploymentContracts","ContractID"
Me.Textbox_2.Value = "tblEmploymentContracts","EmployeeID"
Me.Textbox_3.Value = "tblEmploymentContracts","HireDate"
ElseIf Me.CboOptions.Value = "Qualification" Then
Me.tblDataSheet.SourceObject = "table.tblQualifications"
Me.textbox_1.Value = "tblQualifications","QualificationID"
Me.Textbox_2.Value = "tblQualifications","EmpID"
Me.Textbox_3.Value = "tblQualifications","Certification"
ElseIf Me.CboOptions.Value = "Passport" Then
Me.tblDataSheet.SourceObject = "table.tblPassports"
Me.textbox_1.Value = "tblPassports","Passport_ID"
Me.Textbox_2.Value = "tblPassorts","Number"
Me.Textbox_3.Value = "tblPassorts","EmpID"
ElseIf Me.CboOptions.Value = "Resident ID" Then
Me.tblDataSheet.SourceObject = "table."ResidentID"
Me.textbox_1.Value = "tblResidentID","ID"
me.textbox_2.value= "tblResidentID","Resident_ID"
Me.Textbox_3.Value = "tblPassorts","SponsorID"
Else
Me.tblDataSheet.SourceObject = ""
End If
End Sub
I wanted these three unbound text boxes act accordance to the table i have referenced in above code to enter the new entries (Last row) on each table for these table fields only.
Many thanks in advance for your help.