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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup table viewing

Status
Not open for further replies.

bobsmallwood

Programmer
Aug 9, 2001
38
US
Is there a way to use the lookup function via a form so that more of the fields could be viewed before selecting the record to be inserted into the target table?
 
Not using the default lookup feature but you could easily create your own lookup program using a form showing any fields you want.

Perrin
 
Do you mean I could create a form that would function like a lookup table? That is, a selected record from the lookup form could have its fields inserted as a new record in a new table?
 
Sure, this can be fairly simple to do. I have never used the default lookup feature, I always code my own, I find it default too limiting.

The basics are create a form (I like to make the form a dialog box and disable the title bar properties) for the lookup table and include the desired fields. The form should contain an "Ok" and a "Cancel" button using formReturn("Ok") and formReturn("Cancel"), doesn't have to be ok and cancel, can be anything.

On the main form trap the keyPhysical event for the space key and the control key to duplicate the default key combination. You could also use a button or any other key combination.

Open the lookup form from the main form and issue a wait() if the lookup form returns "Ok" grab the values from the lookup form and insert them into the main form. This is easy to do using the field names if all the fields you need are displayed on the lookup form. If all the fields are not displayed you can still make things work it just takes a little more coding.

Look up formReturn in the ObjectPal help, they have a good example of how to open a form using wait and formReturn.

I hope I didn't make this to confusing, I'm rushing trying to get out of the office.

If you want to attempt this let me know if and where you get stuck and I'll try and walk you through it.

Perrin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top