List value query not retrieving desired results ...

M

Me

I have the following query for list values in combo box,
the query fetches me records for the 1st CONTRACT_NO ...

SELECT FILE_NAME, REC_NO FROM BOILERFILES WHERE
CONTRACT_NO=Forms!DataEntryTO!CONTRACT_NO;

I have the following recs in BOILERFILES -

Contract No Rec Other info ...
1 1 xx1_1
1 2 xx1_2
1 3 xx1_3
2 1 xx2_1
2 2 xx2_2
3 1 xx3_1

for list value for contract No. =1 it shows 1st 3 records which is fine.
for list value for contract No.=2 again it shows the 1st 3 records whereas
it should show 4th and 5th records
for list value for contract No.=3 it shows 1st 3 records it should show the
6th one.

Please help me resolve this asap!

Thank you,
-Me
 
K

KARL DEWEY

Do you have a default value in the form textbox?

Include an output field in the query like --
Form Info: [Forms]![DataEntryTO]![CONTRACT_NO]
This will show you what the query is getting as a parameter from the form.

I would use a slightly different name for the textbox than the field name -
CONTRACT-NO.
 
M

Me

Karl,

Thanks for the reply!

I changed CONTRACT_NO to CONTRACTNO and also tried displaying the
value for Forms!DataEntryTSO!CONTRACTNO, it shows different contractno.
But the list value always shows me records for only the 1st contract.

I am at a total loss!

Thank you,
Renu


KARL DEWEY said:
Do you have a default value in the form textbox?

Include an output field in the query like --
Form Info: [Forms]![DataEntryTO]![CONTRACT_NO]
This will show you what the query is getting as a parameter from the form.

I would use a slightly different name for the textbox than the field name -
CONTRACT-NO.

Me said:
I have the following query for list values in combo box,
the query fetches me records for the 1st CONTRACT_NO ...

SELECT FILE_NAME, REC_NO FROM BOILERFILES WHERE
CONTRACT_NO=Forms!DataEntryTO!CONTRACT_NO;

I have the following recs in BOILERFILES -

Contract No Rec Other info ...
1 1 xx1_1
1 2 xx1_2
1 3 xx1_3
2 1 xx2_1
2 2 xx2_2
3 1 xx3_1

for list value for contract No. =1 it shows 1st 3 records which is fine.
for list value for contract No.=2 again it shows the 1st 3 records whereas
it should show 4th and 5th records
for list value for contract No.=3 it shows 1st 3 records it should show the
6th one.

Please help me resolve this asap!

Thank you,
-Me
 
M

Me

Hi Powderfinger,

Your suggestion works as desired. Thanks a lot!

-Me


Powderfinger said:
In the AfterUpdate event of CONTRACT_NO put

Me.YourComboBoxName.Requery


Use whatever name you have for your combo box.


Me said:
Karl,

Thanks for the reply!

I changed CONTRACT_NO to CONTRACTNO and also tried displaying the
value for Forms!DataEntryTSO!CONTRACTNO, it shows different contractno.
But the list value always shows me records for only the 1st contract.

I am at a total loss!

Thank you,
Renu


KARL DEWEY said:
Do you have a default value in the form textbox?

Include an output field in the query like --
Form Info: [Forms]![DataEntryTO]![CONTRACT_NO]
This will show you what the query is getting as a parameter from the form.

I would use a slightly different name for the textbox than the field name -
CONTRACT-NO.

:

I have the following query for list values in combo box,
the query fetches me records for the 1st CONTRACT_NO ...

SELECT FILE_NAME, REC_NO FROM BOILERFILES WHERE
CONTRACT_NO=Forms!DataEntryTO!CONTRACT_NO;

I have the following recs in BOILERFILES -

Contract No Rec Other info ...
1 1 xx1_1
1 2 xx1_2
1 3 xx1_3
2 1 xx2_1
2 2 xx2_2
3 1 xx3_1

for list value for contract No. =1 it shows 1st 3 records which is fine.
for list value for contract No.=2 again it shows the 1st 3 records whereas
it should show 4th and 5th records
for list value for contract No.=3 it shows 1st 3 records it should show the
6th one.

Please help me resolve this asap!

Thank you,
-Me
 

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