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!

Data in field disappears after refresh

Status
Not open for further replies.

KerryL

Technical User
May 7, 2001
545
US
Form A contains basic company information.
Form B contains detailed company information.
When Form B is opened (from Form A) it carries the company info along with it. (It opens Form B with the detailed info for the company recored being viewed in Form A.)

When detailed info is added to a subform on Form B and then a refresh button is clicked, no problem. However, if one of the fields on Form B is updated and then the refresh button is clicked, the Company name on Form B disappears--goes blank.

As long as updates on Form B are limited to the subform, the refresh works fine. But if any of the fields on Form B are changed, the company name goes blank.

I've tried a number of things but no luck--can't figure out what's causing this to happen and would really appreciate some help. Any ideas?

I can provide more detail on each of the forms and/or on the fields in question if more info is required.

Thanks in advance,
kerry
 
Kerry

(I started posting this AM and got severely distracted)

Several things to check...

1) Verify the integrity of the data. Look at the raw data in the tables. Do you see what is expected? Ensure you do not have duplicate detail entries. With related tables, ensure the primary key on the "one-side" table is being used as the foreign key on the "many-side" table.

2) Look at your ControlSource of your text, list and combo boxes. Text boxes are fairly straight forward. Combo and List boxes are little more complex. In addition to the control source, you have to review RowSource, Bound Column and ColumnWidths.

To accomplish the above, have your form open in design view, and make sure the Properties window is open (from the menu, "View" -> "Properties"). Select the control field (text, list or combo box) in question and then look at the "Data" tab and "Format" tab in the Properties window.

3) It also a good idea to make sure your relationships are properly defined.
 
This problem happens if you use this type of codes...you can check it back by looking at the example prepared by Access in the northwind, try to open the form "Products". But if you want to have more clear example, use the Access templates "Ledger". There you questions should be answered. But if you wanna use this form in .adp enviroment, you have to modifuy the codes, so you have to get to the NOrthwind.ADP.There you can see the codes difference.Hope this help! ;-)
May da force be with thou..
 
Thanks Willir.

I'm going through your suggestions but so far no luck. Any time I edit one of the fields on the form and then hit the refresh button, the Company Name field goes blank and I receive this error:

"This recordset is not updateable.
 
KerryL
My advice was for trouble shooting your work, not fixing it.

Is the data in the tables correct?
To answeer this question, you have to advise us if your company information is if your data is stroed on one table or two tables.

Have you viewed your forms to ensure they are setup correctly. You / we will have to look at the RecordSource for the form, and ControlSources for the fields.

ErrorMsg said:
This recordset is not updateable
...suggests that you are using a query as the RecordSource for the form, and suggests that you have more than one table referenced in the query.

Can you provide us the RecordSource for the form? To this, open the form in design mode and make sure the Properties window is open ("View" -> "Properties"). Select top left corner square of the form where the verticle and horizontal rulers meet. Now select the "Data" tab on the Properties window. The first field will be the RecordSource. It will either reference a table or a query. Based on your error message, I suspect it is a query. Select the RecordSource field and click on the "..." command button that appears to the right of the field to open up the Query Builder. Once the Query builder is open, switch from the GUI interface window to the SQL view (from the menu, "View" -> "SQL View"). Past / post the SQL statement for us to review.

Repeat the above for the second form.

Also, select the CompanyName control field that is giving you grief. Is it a text box, combo box or list box?? Select the control field, and then look at the ControlSource in the "Data" tab of the Properties window. Let us know what it is. Moreover, if this is a combo or list box, we also need to know the value in the RowSource, Boundcolumn and ColumnWidths.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top