Connected Combo boxes

Valerie

Registered User.
Local time
Today, 22:40
Joined
May 7, 2003
Messages
65
I have a form with two connected combo boxes - the first allows selection of a Retailer and the second allows selection of a staff member from the selected Retailer using the criteria [forms]![MyForm]![Retailer] to limit - This all works quite correctly.

The problem is this - when I run this on an average PC (running Windows 98) and click on my Close button (created using the Command button wizard), all is well. When I run this on a higher spec PC (Windows XP) and click on the Close button I get the message "Enter Parameter Value [forms]![VPAFieldReport]![RetailerCode]"

If I remove the Staff Member combo then I no longer see the "Enter Parameter value" message.

Any ideas?
 
Please detail the SQL of both combos
 
Mile-O-Phile said:
Please detail the SQL of both combos

Here is the first called RetailerCode on the form VPAFieldReport:

SELECT [Retailers].[RetailerCode], [Retailers].[RetailerName], [Retailers].[RetailerStreet1], [Retailers].[RetailerStreet2], [Retailers].[RetailerTown] FROM Retailers;

and here is the second

SELECT [VPAs].[RetailerCode], [VPAs].[VPAInitials], [VPAs].[VPAFirstname], [VPAs].[VPASurname], [VPAs].[VPAMemberNo] FROM VPAs WHERE ((([VPAs].[RetailerCode])=[forms]![VPAFieldReport]![RetailerCode]));
 
Is all that necessary for a cascading combo?
Is [ReviewerCode] also the name of a textbox on your form?
 
Mile-O-Phile said:
Is all that necessary for a cascading combo?
Is [ReviewerCode] also the name of a textbox on your form?

Yes I need all the columns to help select the correct entries.

And yes ReviewerCode is the name of the combo box on the form.

I tried changing the name of the combo box to RetailerDisplay but then I got a different parameter value request for [forms]![MyForm]![RetailerDisplay]
 
Are you sure you don't have a references problem? I haven't seen this particular symptom before but usually when a db works fine in one environment but fails in another, the ultimate culpret is a reference library that is not where Access expects it to be.
 
Pat Hartman said:
Are you sure you don't have a references problem? I haven't seen this particular symptom before but usually when a db works fine in one environment but fails in another, the ultimate culpret is a reference library that is not where Access expects it to be.

I've checked the references - they're exactly the same.

Any other ideas?
 
You seem to have a text box with the same name as a field [RetailerCode]. In my experience this can have unpredictable consequences, and if you can't find any other cause, it's worth changing your text box name.
 
neileg said:
You seem to have a text box with the same name as a field [RetailerCode]. In my experience this can have unpredictable consequences, and if you can't find any other cause, it's worth changing your text box name.


Thanks for that - but I've already tried this - (see above) - I called the box [RetailerDisplay] and then I get a different message then [forms]![MyForm]![RetailerDisplay]
 
Is your form really called MyForm?
 
Mile-O-Phile said:
Change that, then. :p
Have now changed the form to TestForm and changed the SQL in the combo box to refer to [forms]![TestFrom]![RetailerCode]

Sadly - I still get the Enter parameter value question "Forms!TestForm!RetailerCode" when clicking on close.

I can't think what else to try!!
 
Try unchecking one of the existing references on your new machine, then compile and save all modules, compact and close and try again
 
Rich said:
Try unchecking one of the existing references on your new machine, then compile and save all modules, compact and close and try again
Thanks for your suggestion.

Have now done this.

I have now discovered the following:

(1) If I run the form from the DB window it works - great.

(2) BUT when I run it from a command button on my main menu form it comes up with the parameter value!!

Is this a bug in Access? (am using Access 2000)
 
Valerie said:
The fix for the Close command is as follows

DoCmd.Echo False
DoCmd.Close
DoCmd.Echo True

Ah ha! I'd be more explicit, though, about what I'm closing.

i.e.

Code:
DoCmd.Echo False
DoCmd.Close acForm, Me.Name
DoCmd.Echo True
 

Users who are viewing this thread

Back
Top Bottom