Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

nee a field on form that can look up data OR let me add my own data

Status
Not open for further replies.

skd2726

MIS
Jul 2, 2002
24
0
0
US
I need a field in a form that can do one of two things .... if the field contains a badge number then add the corresponding employee name from a table or if the field has no badge number then let me add my own employee name

Is this possible?
 
How about a combo box (with limit to list set to no), and a text box

Define the combo box with two columns (BadgeId and Name).
In the after update event put code so

if not isNull(cboBadgeId.column(1)) Then
txtName = cboBadgeId.column(1)
end if

Now if you type in a BadgeId which exists, the name of the EE will be put in the textbox, if not you can type in the name.

If you want to get more sophisticated, use of .Enabled, .Locked and .SetFocus Properties will allow you to step over the text box if BadgeId exists, and to lock it to prevent user entry


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
your link doesn't work ken.

Ian Mayor (UK)
Program Error
Always make your words short and sweet. Because you never know when you may have to eat them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top