If record Does Not Exist?

  • Thread starter malik via AccessMonster.com
  • Start date
M

malik via AccessMonster.com

Hi
I have a form in which i have two Text Fields name "TxtAccountNo" And
"TxtPartyName".
When a user enters the Account No. in text field, the form automatically pull
the Party Name from the table "TblParties"

Now i want that if the user enteres an Account no. that doesnot exist in
"TblParties",
then a msgbox must appear with a message.

Thank you
 
B

bhicks11 via AccessMonster.com

Are you using a combobox to pull the Party Name? If not, how? What is the
code you are using? If in a combobox you can add a Not In List event. If
code, you can return a msgbox if not returned but need more details.

Bonnie
http://www.dataplus-svc.com
 
M

malik via AccessMonster.com

I am using two Text Fields in form.
The source of the form is "TblDrVoucher" which has a relation with
"TblParties" on `PartyId` field.

So when A Party code is entered in TxtAccountNo then it pulls the Party Name
from TblParties.


Are you using a combobox to pull the Party Name? If not, how? What is the
code you are using? If in a combobox you can add a Not In List event. If
code, you can return a msgbox if not returned but need more details.

Bonnie
http://www.dataplus-svc.com
Hi
I have a form in which i have two Text Fields name "TxtAccountNo" And
[quoted text clipped - 7 lines]
Thank you
 
B

bhicks11 via AccessMonster.com

Is TblParties on a subform?

Bonnie
http://www.dataplus-svc.com
I am using two Text Fields in form.
The source of the form is "TblDrVoucher" which has a relation with
"TblParties" on `PartyId` field.

So when A Party code is entered in TxtAccountNo then it pulls the Party Name
from TblParties.
Are you using a combobox to pull the Party Name? If not, how? What is the
code you are using? If in a combobox you can add a Not In List event. If
[quoted text clipped - 8 lines]
 
J

John W. Vinson

I am using two Text Fields in form.

Not quite: you have two *textbox controls* on a form.

Forms don't have fields. Tables have fields; these fields may or may not be
displayed in controls on a Form.
The source of the form is "TblDrVoucher" which has a relation with
"TblParties" on `PartyId` field.

So when A Party code is entered in TxtAccountNo then it pulls the Party Name
from TblParties.

What if the user misspells or mistypes the account number? Do you want to add
a new (mistyped, incorrect) account? Are you storing the Party Name *both* in
the accounts table, and redundantly in TBLDrVoucher? If so, you really, really
don't want to do so!

Normally one would use a Combo Box (rather than a textbox) to allow the user
to *select* the account number from a list of valid account numbers. You can
display - without storing!!! - the Party Name on the form by including the
name in the combo box's row source, and putting a textbox on the form with a
control source like

=comboboxname.Column(2)

where (2) would mean the third field in the combo's row source query (it's
zero based).
 

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