parameter value message

w0od0o

Registered User.
Local time
Today, 21:34
Joined
Jan 13, 2009
Messages
87
Ill try and be as clear as i can although i find explain these issues as hard as solving them ;)

i have created a form with a drop down list of clients to find a specific client to edit the data in another form, all this works fine as long as the form with the dropdown list on is open first, if i want to just simple add a new client i get an Enter parameter value message come up,

my aim is to just be able to select a client from a list which in turn opens my client form ready to edit on the selected client, but i also need to be able to add a new client with out this parameter message

i have used a query to create the form and in that query i now have in the criteria under company
Like [forms]![selectclient].[selector] & "*"

some help on an alternate or a solution is grateful

thanks

w0od0o
 
It sounds as if the form you are opening has a query as it's data source, and the Query is using the value of the Combo as it's criteria.

This works fine as you have discovered so long as you open the form with the combo on it first. However when you try and run the query without having the form with the combo on it open you will always get the request for parameter pop up.

What I would do would be to have your second form based on a table or a simple query that has no criteria in it. Then on your first form behind your button put the following code;

Code:
    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "FRM_Your2ndFormName"
    
    stLinkCriteria = "[ItemID]=" & Me![Combo0] [COLOR="Green"]'Replace ItemID with whatever field you are linking on and Combo0 with your combo box name[/COLOR]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

If you use this method, when you click on your button your second form will open filtered, only showing the data relevant to the selection in your combo box. However if you simply open your second form all data will be available for viewing or editing, or you can set it up to open directly at a new record.
 
Last edited:
thank you very much,

works like a dream :)
 

Users who are viewing this thread

Back
Top Bottom