FORM QUESTION

eric5689

New Member
Joined
Sep 23, 2003
Messages
6
Hi,

I have a question about updating a form from a sub form. I have Form A (Main Form) and Form B (Sub Form). I click a button on Form A that launches Form B. I type in Form B and then click on a button on Form B that closes Form B and saves the info. Form A updates the info from Form B only if I refresh Form A. Is there a way to automate the info shows up on Form A without having to refresh.

Thanks



Eric
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hi, I'm not sure I understand the problem 100%. Are the two forms separate forms (you mentioned clicking a button to launch Form B) or are they a genuine form with a subform? (i.e. where you view both at the same time?) Assuming they are separate forms and depending on how you created the code behind the close button, have you looked at adding the "Requery" command into your code / macro? I think this would have the effect you described. Lastly, can the information that can be changed in Form B, also be changed in Form A?
HTH, Andrew. :)
 
Upvote 0
Andrew,

Form B is a subform of form A. Sorry if I confused you. I can view subform B and form A at the same time. I want form A to update with whatever I type in subform B without refreshing form A. If I click on refresh form A then the text from subform B appears in form A. I want the text from subform B to appear without having to refresh form A
.
 
Upvote 0
Hi Eric

Can you elaborate on the information that is changing in Form A? You mentioned text fields in your last post so are you wanting to show copies of the text you are entering into Form B, on Form A? If so, I'm not sure that the main form / subform are being used correctly - ordinarily you would have header-type information in the mainform and detailed information (usually information on the many side of a one-to-many relationship) in the subform. Unless I am misunderstanding your question, then I would have thought the information you are changing in the subform should be presented on the main form instead. However, I have seen totals being updated on main forms based on data in the subform but not text - so we might need some more info.

Lastly (sorry for the questions but Id rather we got this right first time) is the form based on a query or a table? And what tables does the data come from and what is their relationship?

Andrew
 
Upvote 0
The form is based on a table. The table is tracking various system errors for my company. The user is typing a description of the error in the subform. I want it to update the main form without having to refresh.
 
Upvote 0
You said you needed to click a button to refresh the data on form A. Well could you get the code from behind that button and paste it onto the other button that also saves the data, (make sure you put the code after the saving code otherwise it will refresh the data before it saves.) that way when you save it, and it returns to form A it is already updated.
 
Upvote 0
No, I don't click a button to refresh the form. I go to the menu and select refresh. I'm wondering what the code is to automatically refresh the form.

Sincerely



Eric Adrian
 
Upvote 0
Hi Eric
Sorry but I'm just not getting it - if the data is all coming from one table then why do you have a main form / sub form set-up? You mentioned you are entering errors into the subform, but what is being entered into the main form? And what is being updated on the main form? If it is a count of the errors then you can do this in a form header / footer without need for a main form / sub form arrangement.
Andrew
 
Upvote 0
welll im not sure about access code. but when i'm linking an access database to visual basic and i want to refresh the data, the code is
adodc1.Refresh
but thats for visual basic. not access. I'm not completely sure what the code is but maybe that can help you to some extent.
maybe something like, filename.[form_formname].refresh
that should work
i have one set up for a program call assistance
and the code is
assistance.[from_Detailed Report].refresh
so something alone those lines
 
Upvote 0

Forum statistics

Threads
1,221,854
Messages
6,162,450
Members
451,765
Latest member
craigvan888

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top