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

LookUP (Should Be easy I am stupid today)

Status
Not open for further replies.

lashwarj

IS-IT--Management
Nov 1, 2000
1,067
US
DATABASE
tax_map

FIELDS
taxmapid
parcelid

COMMAND BUTTON
find

I want it so when I click in one of the fields and enter a value it will lookup the other value.
EX. I click on taxmapid and enter a value, when i click find I need it to look up the parcelid and vise versa.

The fields are stored in a database and they are already on the same record, users just need to be able to look up the taxmapid = parcelid or the parcelid = taxmapid

So which ever field is clicked has to have the criteria met
 
Are you refering to a form? If so in the click event of the commandbutton:
SELECT TAX_MAP
LOCATE FOR TAXMAPID = THISFORM.PARCELID.VALUE && Assuming it's in a textbox you enter the value.
 
no I am actaully typing it over the field value, i have the two text boxes on the screen with the control source set to each field. I need for it to search for the field clicked first. So if i click in field parcelid i need it to show the taxmapid that eqauls the parcelid and if i click in the taxmapid i need it to show the parcelid that equals the taxmpaid
 
To have it search, you need to use a text box that is NOT bound to the table. Otherwise you will overwrite the current record with the number you typed in!

Use 2 textboxes, one for parcelid and the other for taxmapid. Create a couple of form properties to bind them to if you like...it makes data access a little easier. Also create a form property called "camefrom" that will keep track of which field you're using. In the GotFocus() event of each textbox, set thisform.camefrom to an appropriate value.

When you hit FIND, depending on which textbox you're searching from, do a SEEK or LOCATE on the appropriate field, which will move the record pointer to that record. Then fill the other textbox with the necessary value.

Hope that helps,

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top