0

I have an Access database with a form. The form has 2 combo boxes (Combo0 and Combo2). I'm trying to get Combo2 to populate based on the value in Combo0. I'm trying to do this with an AfterUpdate event.

When I try to select a value in Combo2, I get the following message:

The record source" SELECT........" specified on this form or report does not exist. The name of the recordsource may be misspelled, the recordsource was deleted or renamed, or the recordsource exists in a different database. In the Form or Report's Design view, or Layout view, display the property sheet by clicking the Properties button, and then set the RecordSource property to an existing table or query"

This seems like a simple thing to do but I'm obviously missing something here. Any suggestions would be GREATLY appreciated .....Thank you

Shaves
  • 884
  • 5
  • 16
  • 46

1 Answers1

0

I have a Combobox1 set for my Client Company and then a Combobox2 set for the Client Contact. My Combobox2 changes depending on which Client Company I select.

Combobox2 Row Source Type = Table/Query

Combobox2 Row Source = see below

SQL

SELECT [Clients - Contacts].ID, [Clients - Contacts].[Full Name], [Clients - Contacts].Company
FROM [Clients - Contacts]
WHERE ((([Clients - Contacts].Company)=[Forms]![dshbProjectDetails]![CompanyID]));

Picture: Query Builder

enter image description here

After Update Event on Combobox1 = Macro: Requery; Control Name Combobox2

Harun24hr
  • 30,391
  • 4
  • 21
  • 36
  • @NathanGonzalez............Thanks...This has helped. Private Sub Contract_ID_AfterUpdate() Me.Work_Description.RowSource = "SELECT [Work Descriptions].[Work Description] FROM Contract INNER JOIN [Work Descriptions] ON (([Contract]. [ContractID] = [Work Descriptions].[Contract ID]) AND ([Work Descriptions]. [Contract ID] = [Contract].[ContractID])) AND ([Work Descriptions].[Contract ID] = Contract.ContractID)" & _ "WHERE ([Contract].[ContractID])=" & Contract_ID.Value Me.Work_Description.Requery End Sub – Shaves Sep 25 '20 at 11:27
  • I've started using the VBA code above in the AfterUpdate event. The list count is correct but it is not populating the 2nd combobox. Is there a property that might be causing this? Thanks again for the help. – Shaves Sep 25 '20 at 11:29
  • @Harun24HR..........Thank you. The comboxes are not populating. The listcount is correct but I can't see the values in the 2nd combobox. Any thoughts on what might e causing this? Thanks for your help. – Shaves Sep 25 '20 at 11:30