473,385 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Update form from other form

2
Hey,
I have two forms in microsoft access. One of them (add form) is supposed to create a new entry into a table. The other form (edit form) is supposed to allow you to edit the entries of the table. I am having difficulty making this work properly. The edit form will only work for the original members of the table, not for any of the entries that were added using the add form. The add form works by allowing the user to input the data and then click a button called add entry on the form. This should add the new entry into the table and allow it to be accessed using the edit form. This is not happening though. Is there any way I can do this?
Thank you
Jun 21 '10 #1
3 1558
jimatqsi
1,271 Expert 1GB
Are these two forms working in tandem? I mean to you click a button on the edit form to launch the add form and then close the add form when you are done adding? Something like that?

If that is what you are doing, make sure you put this code in before you launch the add form
Expand|Select|Wrap|Line Numbers
  1. if me.dirty then me.dirty = false
That will make sure the record being edited is written to disk and no longer locked.

Also, after the addition is done, you'll want to force the edit form to do a requery. That will update the data set for that form. You can do that from the add form with Forms!nameOfEditForm.requery. Then when you close the add form the edit form will have the new record(s).

Jim
Jun 21 '10 #2
kBlack
2
Thanks Jim,
The two forms work together but neither form calls the other. The add form will create a new record/entry that should be added to the edit form. For some reason, this is not happening. The add form will add the new entry to the main table, but the edit form does not change. How could this be fixed?
Thanks
Jun 21 '10 #3
jimatqsi
1,271 Expert 1GB
You need to requery the database. Depending on your system option settings, you might have a toolbar option to do that. It will be under the Records pull-down menu, "Refresh."

Or just add a little code to the Add form, so after it adds a record to the database it does a .requery on the other form.

Jim
Jun 21 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: genetic.error | last post by:
I'm moving from Vb6 to VB.Net. I have a feeling this has come up before... The VS.Net MSDN file seems to state that the following should work: Form1.Show Form1.Visible = True Form1.Hide...
1
by: ed_spain | last post by:
Hi Everyone, On an HTML page with 2x different forms, how can I redisplay the same page after a submit, restoring the values from BOTH forms even though only one was submitted? I have an...
1
by: Primerov | last post by:
Why i cannot update from another form? I have an update function called UpdateData that works otherwise,but not from another form. Why is it so? I am trying to update tables from the form F1.There...
15
by: http://www.visual-basic-data-mining.net/forum | last post by:
Does anyone have any idea how to transferring data from TextBox1 in form1 to textBox2 in form2..... That means after i fill in any data in textBox1 and click Next button... It will bring me to...
21
by: Just Me | last post by:
I've tried in a few places using a variable name Form and it appears to be OK. For example: Public Shared Sub WritePositionsInRegistry(ByVal Form As Form, ByVal SubkeyName As String) Is it OK...
2
by: Elmo Watson | last post by:
Control1 is on Form1 on Form two - I'd like to access the instanciation of that control (Control1), using different properties & methods Is there a way, in VB.Net, to refer to a control on...
3
by: rajashekar4dotnet | last post by:
how to open one form from the other form and close the first form if there are only two forms in windows application(VB.net) i had tried this method dim f as new form2 form2.show( )...
2
by: iDesmet | last post by:
Hallo, I have 2 forms. In one form (let's call it frmClient) I have textboxes, comboboxes, etc in which I can save/update information to a database (MySQL to be more exactly). The other form...
3
by: kate2272 | last post by:
Hi Guys I was wondering if it is possible to turn AllowEdits to false after data has been entered for individual fields within a form/sub-form. I've found that I can do this in the 'AfterUpDate'...
1
by: scudsong | last post by:
I override ProcessCmdKey() in my MDI parent form class and have some keyboard shortcut calling method in same class. But I wish to make these hotkeys working in parent/child form and other form. The...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.