subform control data source query not working

M

Mark Kubicki

on my main form [frmSpec] I have a combo control [cboManufacturer], and a
subform [fsubManufacturerAlternates]

On that subform [fsubManufacturerAlternates] is the combo control
[cboManufacturerAlt] whose data source is written as

SELECT Manufacturers.ManufacturerName
FROM Manufacturers
WHERE
(((Manufacturers.ManufacturerName)<>[Forms]![frmSpec]![cboManufacturer]))
ORDER BY Manufacturers.ManufacturerName;

however, it is not finding <>[Forms]![frmSpec]![cboManufacturer]

where should I be looking for this error?

I've checked the spelling,
and
the field Manufacturers.ManufacturerName , as well as it's source
Manufacturers are correct
and
when I type into the "parameter not found" prompt the value of
cboManufacturer, the query presents properly...

thanks in advance,
Mark
 
R

roger

Its timing. there is no value in the control at the time the form opens.
you could do a number of things:

1: unbind the subform and use the mainform's oncurrent event to update the
subform.
or
2: store the value (from the main form) somplace else. another form, a
memory variable thats available before the form opens and change the query
to get the value there.
hth
Roger
 
M

Mark Kubicki

i confused:
behind the control's "got focus" event there is code to requery the row
source, this is when the error occurs (not when the form opens) and ther
will always be a value in the field: forms!frmSpec.manufacturer?


roger said:
Its timing. there is no value in the control at the time the form opens.
you could do a number of things:

1: unbind the subform and use the mainform's oncurrent event to update
the
subform.
or
2: store the value (from the main form) somplace else. another form, a
memory variable thats available before the form opens and change the
query
to get the value there.
hth
Roger



Mark Kubicki said:
on my main form [frmSpec] I have a combo control [cboManufacturer], and a
subform [fsubManufacturerAlternates]

On that subform [fsubManufacturerAlternates] is the combo control
[cboManufacturerAlt] whose data source is written as

SELECT Manufacturers.ManufacturerName
FROM Manufacturers
WHERE
(((Manufacturers.ManufacturerName)<>[Forms]![frmSpec]![cboManufacturer]))
ORDER BY Manufacturers.ManufacturerName;

however, it is not finding <>[Forms]![frmSpec]![cboManufacturer]

where should I be looking for this error?

I've checked the spelling,
and
the field Manufacturers.ManufacturerName , as well as it's source
Manufacturers are correct
and
when I type into the "parameter not found" prompt the value of
cboManufacturer, the query presents properly...

thanks in advance,
Mark
 
R

roger

try the "AfterUpdate" event

Mark Kubicki said:
i confused:
behind the control's "got focus" event there is code to requery the row
source, this is when the error occurs (not when the form opens) and ther
will always be a value in the field: forms!frmSpec.manufacturer?


roger said:
Its timing. there is no value in the control at the time the form opens.
you could do a number of things:

1: unbind the subform and use the mainform's oncurrent event to update
the
subform.
or
2: store the value (from the main form) somplace else. another form, a
memory variable thats available before the form opens and change the
query
to get the value there.
hth
Roger



Mark Kubicki said:
on my main form [frmSpec] I have a combo control [cboManufacturer], and a
subform [fsubManufacturerAlternates]

On that subform [fsubManufacturerAlternates] is the combo control
[cboManufacturerAlt] whose data source is written as

SELECT Manufacturers.ManufacturerName
FROM Manufacturers
WHERE
(((Manufacturers.ManufacturerName)<>[Forms]![frmSpec]![cboManufacturer]))
ORDER BY Manufacturers.ManufacturerName;

however, it is not finding <>[Forms]![frmSpec]![cboManufacturer]

where should I be looking for this error?

I've checked the spelling,
and
the field Manufacturers.ManufacturerName , as well as it's source
Manufacturers are correct
and
when I type into the "parameter not found" prompt the value of
cboManufacturer, the query presents properly...

thanks in advance,
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top