differences between 2 popup forms that are basically identical

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a popup form using a combo box to allow selection criteria, which then
calls a form using Openform with a Wherecondition clause containing 2
conditions(year = 9999 and period = 9).This works ok.

I copied the pop up form to another pop up form and used the exact same code
to call a different form but with the exact same where condition used. In
this case the 'Enter Parameter query' box appears asking for the Year and
Period no to be entered.
The 2 called forms both use the same underlying query as the record source,
one uses the query in conjunction with another table, the other (working)
uses the source code that matches the created query.
is there something I've missed or has the copying somehow screwed up the 2nd
pop-up?

Cheers,
Steve
 
If I'm understanding what you're saying, your query is pointing to controls
on the form to get its values.

Did you type the name of the control properly
(Forms!NameOfForm!NameOfControl)? Is the Form referred to open when the
query runs?
 
The combobox control allows the entry of the selection criteria, from which
is derived the 2 'parameter' values used in the wherecondition argument in
OpenForm

i.e.
varwhere = "FinancialYear = " & intfinyr & " AND PrdNo = " & intPrdNo

On calling the form with DoCmd and wherecondition := varwhere , the
parameter requests appear, which I assume occurs when the called form tries
to resolve the recordsource sql with the additional varwhere condition.
I have tried using the tablename.columnname in the varwhere statement to no
avail as well.
 
By any chance are either of those two fields Text in the underlying table,
as opposed to Numeric? What you're showing below will only work for numeric
fields: for text fields, you need to add quotes around the values:

varwhere = "FinancialYear = '" & intfinyr & "' AND PrdNo = '" & intPrdNo &
"'"
 
Back
Top