Re: Open a Form in Add Mode
From: Ripper (anonymous_at_discussions.microsoft.com)
Date: 03/25/04
- Next message: Graham Mandeno: "Re: Scheduling notification emails"
- Previous message: Gerald Stanley: "Re: Dependent Combo Boxes"
- In reply to: Dirk Goldgar: "Re: Open a Form in Add Mode"
- Next in thread: Dirk Goldgar: "Re: Open a Form in Add Mode"
- Reply: Dirk Goldgar: "Re: Open a Form in Add Mode"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 25 Mar 2004 14:26:07 -0800
Thanks!
Exactly what I needed. I have the kiddos click a finished button that closes the form, but I have seen a problem where their answers go blank. I know that they just are on a new record, but I can't figure out how they are doing that.
Rip
----- Dirk Goldgar wrote: -----
"Ripper" <anonymous@discussions.microsoft.com> wrote in message
news:BA440E22-1728-4325-B71A-0C9FAFA76A1E@microsoft.com
> I use this code to open a form. What I want is for the form to open
> up in add mode. My students are taking a test and I want them to
> only add 1 record each.
>> Dim stDocName As String
> Dim stLinkCriteria As String
> stDocName = "frmTest9"
> DoCmd.OpenForm stDocName, , , acNormal
>> Will this code work for what I want to do?
>> Thanks As Always,
> RIP
Change this line
> DoCmd.OpenForm stDocName, , , acNormal
to this:
DoCmd.OpenForm stDocName, , , ,acFormAdd
This will open the form in data-entry mode, so they only see a blank
record to fill in. It will not, though, prevent them from adding more
than one record. For that -- if that's what you want -- you'll need
extra code; possibly something like this in the form's AfterInsert
event:
Private Sub Form_AfterInsert()
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
- Next message: Graham Mandeno: "Re: Scheduling notification emails"
- Previous message: Gerald Stanley: "Re: Dependent Combo Boxes"
- In reply to: Dirk Goldgar: "Re: Open a Form in Add Mode"
- Next in thread: Dirk Goldgar: "Re: Open a Form in Add Mode"
- Reply: Dirk Goldgar: "Re: Open a Form in Add Mode"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|