UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> I Want To Open A Form To Add Records, But I Need To Refresh Before Closing, Access 2013    
 
   
jmkeuning
post Mar 30 2020, 04:17 PM
Post#1



Posts: 262
Joined: 20-October 15



I have a form with subforms. One of the subforms is email addresses. The main form has a button to send emails to the addresses in the subform. The problem is that, as far as I can tell when I open the form in acFormAdd mode, the table that connects the email addresses to the main ID does not populate. So I need to figure out how to refresh the form. But a refresh leaves the record and sticks me with a blank new record.

So is there a way that, after I enter the information, switch the from from acFormAdd to the normal view? Where I can refresh the data with something like DoCmd.RunCommand acCmdSaveRecord?

Alternatively, I can use an Onload event to look at the ID field, and if is blank, take me to a new record. But I do not know how to do that either!
Go to the top of the page
 
theDBguy
post Mar 30 2020, 04:26 PM
Post#2


UA Moderator
Posts: 78,094
Joined: 19-June 07
From: SunnySandyEggo


Hi. You said you're using a form with subforms. Which form are you opening in acFormAdd mode? The main form or the subform?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
jmkeuning
post Mar 30 2020, 04:35 PM
Post#3



Posts: 262
Joined: 20-October 15



The main form.

DoCmd.OpenForm "frmMediaEntryCopy", , , , acFormAdd

The SetFocus part
Go to the top of the page
 
theDBguy
post Mar 30 2020, 04:37 PM
Post#4


UA Moderator
Posts: 78,094
Joined: 19-June 07
From: SunnySandyEggo


So, that means you'll have to enter a value on the main form first and then enter values in the subforms after. Is that what you're doing? Where is the value that's missing? In the main or subform?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
jmkeuning
post Apr 2 2020, 04:49 PM
Post#5



Posts: 262
Joined: 20-October 15



That took longer than I expected to figure out. And it solved my problem!

It's the value on the main form that is missing. But thinking about it in those terms helped me find out exactly where the problem was occurring and I was able to fix it. I had a query that was filtering on the CaseName (the key field) on the main form, but that value had not been updated yet (from the subform). I just switched the query to grab the CaseName from the subform and it worked. Lovin it. Thanks!
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    25th May 2020 - 07:55 PM