Form-based query showing no data

keeling1

Registered User.
Local time
Today, 03:06
Joined
Jun 8, 2009
Messages
27
I posted earlier about a similar problem and got some useful help, so I thought I'd try this one here too. I'm a beginner, so please be gentle.

I have a very simple form-based query set up. The form is called 'frmTeams', and the query is called 'qryOpenTagsByTeam'. The form has a single combo-box (named 'cboTeam') with 'OK' and 'Cancel' command buttons. All the user needs to do is select a choice from the combo-box and click OK. This should start the query and use whatever the user selected in the combo box into the query criteria.

I have the 'OK' command button linked to the query with the following VBA code:

Private Sub cmdOK_Click()
DoCmd.OpenQuery "qryOpenTagsByTeam", acViewNormal, acEdit
End Sub

In the query I have the following Criterion:

[Forms]![frmTeams]![cboTeam]

What happens is that the query opens, but it shows no data. I have the form open, so that's not the problem. After going through many books, I can't figure out why it's not working like it should. Any help would be most appreciated.
 
In general, you see data on a form when

1. You have a recordsource bound to the form

2. You have selection criteria that don't exclude all records.

3. The controls are all marked as .VISIBLE (property of a control).

In this case, from your description, I don't see any evidence of binding (#1)

You have a separate query. If the query isn't the recordsource for the form, you have not bound anything.

Try using a form wizard on your query. Then, for that selection box, destroy the text box created by the wizard and rebuild it using a combobox wizard. That will give you three options, one of which is to select records according to your combobox selection.
 
Thanks for your response, Doc Man. I'm not entirely clear what you're saying here, but I guess I should mention something I didn't say in my first post: the combo box's record source is a table called 'tblTeams'. So my form falls under your first category here.

Your suggestion about using a form wizard on my query sounds promising. But I frankly don't know what this means. I know how to use the form wizard, but how do you do this "on the query"? I tried to create a new form using the form wizard while the query was open, but it tried to create something that looks like a form, and it didn't produce a text box. Nor did it allow me to create any new objects.

Thanks for being patient with me. Like I say, I'm very new to Access.
 

Users who are viewing this thread

Back
Top Bottom