Parameter from form

Alvin

Registered User.
Local time
Yesterday, 20:16
Joined
Jul 10, 2003
Messages
13
I'm new at this, but trying to learn.

How do I use a combo box on a form to enter a parameter that is needed in a module or query. I have all the data collected from various tables/queries, and now want to perform a caluation based on this parameter. The value could be any one of 20 values in the combo box. I can't seem to get it connected. So far all I get is an automatic pop up from Access asking for the parmater value. Everything works when I input a value in the pop up.

The module function is :

Public Function CPrice(DoorStyle As String, Width As Double, Height As Double, Depth As Double, CabName As String) As Integer

"DoorStyle" is the parameter I want to enter through the combo box values. All other values come from a query.

Any help would be appreciated
 
Is the function being called from the query? If so, make sure you reference the field containing the DoorStyle string on the form correctly. It should be of this form:
Forms![yourformname]![doorstylefieldname]

If you are calling the function from the query, then it would look like this:
=CPrice(Forms![yourformname]![doorstylefieldname],etc
 
Thanks.

Yes, is called from the query that compiles the data from other sources. I tried your suggestion but got a compile error. Do I need to put the same reference in the Module, or leave it as [DoorStyle]?
 

Users who are viewing this thread

Back
Top Bottom