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

Form textbox

Status
Not open for further replies.

WWinter

MIS
Apr 23, 2000
38
US
When I put in a company id in a text box to display the company info on a form the new info does not display until I save the record and all looks great and runs great, but I would like it to update before saving, I tried putting ThisForm.Refresh() in the lost focus of the textbox but this does not update the fields. Where do I put ThisForm.Refresh() to update when I tab out of the box.

Thanks Bill Winter
 
...there is not enough information for me to answer your question...I have more questions than answers given what you have said...

1. In what object.event do you have the code that is moving the record pointer to the company that matches the ID that the user has typed in

2. Is the Information displayed on the screen directly from a table, view or a cursor and if a view or a table what is the buffering mode that you have selected for it

3. What new info is displayed when you save the record and into which table(s) are you saving the new record

4. Do the textboxes have a controlsource assigned (are they bound)...most specifically is the Textbox that the ID is going into bound to a field in your table or view?

...those are just a few of the questions I would need answered before I could give you a good answer that would work for you...my answer to you now given what you wrote would be: You need to put it in an event after the datasource record(s) contain the information you want displayed, and I know that isn't the kind of answer you are looking for. Slighthaze = NULL
 
Hi

I assume that your comany name, address etc.. are in an EditBox or in a TextBox adjacent to the companyId field.

The problem could be that you have bound the TextBox/EditBox to the master table.. fine.. that is Ok..

But you have set the relation to the CompanyId to the master table so that the records are auto found as the records are skipped.. This is where the problem is..
SInce your blank record does not have a companyId field value, the related master tables record is not located in any record.. and infact goes to EOF()..

To rectify the situation.. what you have to do is..
1. Dont set the relationship to company id to the master table.
2. In order that the correct masters are found and displayed.. put the following code in the refersh event of the TextBox or EditBox controlling the display of company name etc..
RefreshEvent..
SEEK(ThisForm.CompanyIdField.Value,"myMasterTable")

what in effect takes place.. is that.. when you skip or update.. the company Id field gets the value .. and the refresh event seeks the value in the master table.. However the control is bound to master table and so displays that records value.

Hope I have explained it reasonably :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
Happy New Year [bigears] [party] [2thumbsup]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top