Adding a new record in a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that is called when the user wants to add a new record (to schedule). In order to speed it up, I open
the form with

DoCmd.OpenForm "form1",,,,acFormAdd

My backend is SQL server 2k and a trigger fires when the record is added to insert a new record
into a related detail table. I requery the form to gain access to the fields on the detail table (included in the underlying form
query). Trouble is, the form opens with a new record only. I need to see the record I was just editing.

Do I need to start over and use a different methodology altogether?
Thanks so much for the help.
SMK
 
Hi,

Why requery the entire Form? I would guess that the detail information is
a subForm (correct me if I'm wrong). Thereby, I would just requery the
subForm control, example:

Private sub command1_Click()
Me.SubFormControl.Requery
End Sub

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."




--------------------
| Thread-Topic: Adding a new record in a form
| thread-index: AcPoE3Bp0j8PsE/uR5iRRxKA2AAoSA==
| X-Tomcat-NG: microsoft.public.access.gettingstarted
| From: "=?Utf-8?B?U01LMg==?=" <[email protected]>
| Subject: Adding a new record in a form
| Date: Sat, 31 Jan 2004 08:01:08 -0800
| Lines: 12
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.access.gettingstarted
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.access.gettingstarted:144225
| NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
| X-Tomcat-NG: microsoft.public.access.gettingstarted
|
| I have a form that is called when the user wants to add a new record (to
schedule). In order to speed it up, I open
the form with

DoCmd.OpenForm "form1",,,,acFormAdd

My backend is SQL server 2k and a trigger fires when the record is added to
insert a new record
into a related detail table. I requery the form to gain access to the
fields on the detail table (included in the underlying form
query). Trouble is, the form opens with a new record only. I need to see
the record I was just editing.

Do I need to start over and use a different methodology altogether?
Thanks so much for the help.
SMK
|
 
The detail information is in a table with a LEFT JOIN to the main table (in the underlying form query). So I requery the form to get those fields. I could put it back into a subform, but prefer the join.
Thanks for your help.
SMK
 
Back
Top