If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Updating Record

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-12-12, 10:45
rwest rwest is offline
Registered User
 
Join Date: Dec 2011
Posts: 9
Updating Record

Hello
I have a form where I can enter a new record. on this form there is a button to open a new form where you can enter information related to the record. The first form's record source is a table. The second form's record source is a query with data from the first form's table. My problem is that after I enter a new record and click on the button to get to the second form, the new record information does not show on the second form. Is there a way to update the record immediately after I input it without saving or closing the form. I have tried doing different refresh or requery commands but it doesn't seem to work. Thanks for any help.
Reply With Quote
  #2 (permalink)  
Old 01-12-12, 10:58
SoftwareMatters SoftwareMatters is offline
Registered User
 
Join Date: Mar 2009
Location: Dorset
Posts: 78
You wo't be able to see it unless you save ity bercause technically it isn't there.

So to save it just add the following line of code before the open command:

DoCmd. RunCommand acCmdSaveRecord

(but with no space betwen the . and Run)
__________________
Regards
JD

Bespoke Access Database Design and Development Services
Software Matters - Simple Solutions That Work!
Reply With Quote
  #3 (permalink)  
Old 01-12-12, 13:32
rwest rwest is offline
Registered User
 
Join Date: Dec 2011
Posts: 9
Thank you very much! That was very helpful. As an addition to my question the button is in a subform,and it saves those records perfectly. My other question is if there is a command to save the records from the form as well?
Reply With Quote
  #4 (permalink)  
Old 01-12-12, 14:18
Sinndho Sinndho is offline
Registered User
 
Join Date: Mar 2009
Posts: 3,446
In the Form module:
Code:
Me.Dirty = False
__________________
Have a nice day!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On