Enter Parameter Value Problem

  • Thread starter Thread starter J. B.
  • Start date Start date
J

J. B.

Hey all,

I am trying to pass the value of a bounded combo box on one form to an
unbounded combo box on another form. I keep receiving Enter Parameter Value
Customers when I try to execute the code. Here is the code:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmContactList"

stLinkCriteria = "[Customers]=" & Me![CustID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Even if I enter a number of a Customer the frmContactList still opens blank.
Any help would be much appreciated.

Thanks in advance,

JB
 
The code you post only open ther frmContactList and filter
its RecordSource to those Records that has [Customers] =
{a numeric value from CustID of your current Form). It
does *not* assign any value to the unbound ComboBox on
frmContactList as per your description.

1. Is [Customers] a *numeric* Field? Is it included in
the RecordSource of the Form frmContactList?

You need Yes to both questions for your filter to work.

2. You can get the [Enter Parameter Value] dialog if any
Field name is not recognized in the RecordSource of the
Form or the RowSources of the ComboBoxes / ListBoxes on
the Form. Also your ComboBox may be based on a
parametrised Query and if Access cannot resolve the
Parameter(s), it will ask you for the value(s).

HTH
Van T. Dinh
MVP (Access)
 
Thank you for your post.

To answer the first question; [Customers] is a numeric field and is included
in the RecordSource of the Form frmContactList. The [Customers] combo box
is nothing more than combo box built on a table query involving two fields,
the Name and CustID in that sequence. Actually the only difference between
the [Customers] query and the query coming from the combo box on the Form
frmDataEntryCall is that the [Customers] query is has an ORDER BY
tblCustomer.Name clause sorting the Names of the customers.

For the second question, I have even added the column value on the Me!CustID
value in hopes to be more specific. I was wondering if there was a
different approach to solving this problem.

Thanks for you help. It is much appreciated.

Van T. Dinh said:
The code you post only open ther frmContactList and filter
its RecordSource to those Records that has [Customers] =
{a numeric value from CustID of your current Form). It
does *not* assign any value to the unbound ComboBox on
frmContactList as per your description.

1. Is [Customers] a *numeric* Field? Is it included in
the RecordSource of the Form frmContactList?

You need Yes to both questions for your filter to work.

2. You can get the [Enter Parameter Value] dialog if any
Field name is not recognized in the RecordSource of the
Form or the RowSources of the ComboBoxes / ListBoxes on
the Form. Also your ComboBox may be based on a
parametrised Query and if Access cannot resolve the
Parameter(s), it will ask you for the value(s).

HTH
Van T. Dinh
MVP (Access)


-----Original Message-----
Hey all,

I am trying to pass the value of a bounded combo box on one form to an
unbounded combo box on another form. I keep receiving Enter Parameter Value
Customers when I try to execute the code. Here is the code:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmContactList"

stLinkCriteria = "[Customers]=" & Me![CustID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Even if I enter a number of a Customer the frmContactList still opens blank.
Any help would be much appreciated.

Thanks in advance,

JB


.
 
1. Like I wrote in my previous post, you have not assigned any value to the
unbound ComboBox with the code you posted!

If you want to do so, add code like:

stLinkCriteria = "[Customers]=" & Me![CustID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoEvents
Forms(strDocName)!UnboundComboBox = Me![CustID]

2. Note that because you use the strLinkCriteria (WhereCondition argument),
the frmContactList is likely to have only 1 Record in its (filtered)
RecordSource.

3. I am not even sure what you were trying to do from the second paragraph
of your post.
 
Back
Top