I have a form for a fax cover table.
The user types in the company name and populates the contact and fax number fields with data for the company. Only problem I get the contact part to work but for some reason can not get the fax field to populate. Contact info is in a companycontacts table and fax number is in main company table. Code i have so far is
FaxCompany_AfterUpdate()
Dim strSQL As String
strSQL = "SELECT DISTINCTROW [Contacts].[CONID], [Contacts].[CONFirstName]" & "&" & "' '" & "&" & "[Contacts].[CONLastName] FROM [Contacts] WHERE ((([Contacts].[CONCompany]) = " & Me.FaxCompany & ");"
Me.CONID.RowSource = strSQL
Me.CONID.Requery
The above works great have no problem but below will notwork
Private Sub FaxCompany_AfterUpdate2()
Dim strFax As String
strFax = "SELECT DISTINCTROW [Companies].[Fax] FROM [Companies] WHERE ((([[Companies].[ID]) = " & Me.FaxCompany & ");"
Me.Fax.Rowsource = strFax
Any suggestions? Thanks in advance Mary Ann
The user types in the company name and populates the contact and fax number fields with data for the company. Only problem I get the contact part to work but for some reason can not get the fax field to populate. Contact info is in a companycontacts table and fax number is in main company table. Code i have so far is
FaxCompany_AfterUpdate()
Dim strSQL As String
strSQL = "SELECT DISTINCTROW [Contacts].[CONID], [Contacts].[CONFirstName]" & "&" & "' '" & "&" & "[Contacts].[CONLastName] FROM [Contacts] WHERE ((([Contacts].[CONCompany]) = " & Me.FaxCompany & ");"
Me.CONID.RowSource = strSQL
Me.CONID.Requery
The above works great have no problem but below will notwork
Private Sub FaxCompany_AfterUpdate2()
Dim strFax As String
strFax = "SELECT DISTINCTROW [Companies].[Fax] FROM [Companies] WHERE ((([[Companies].[ID]) = " & Me.FaxCompany & ");"
Me.Fax.Rowsource = strFax
Any suggestions? Thanks in advance Mary Ann