FORM-SUBFORM DATA ENTRY MODE PROBLEM!!

M

Mike S. S.

I have a form with a subform that works just fine when Allow Addition, Edit,
and Deletions is YES. However, I needed to make this form a new records data
entry only form, so I changed the Allow Edits, Deletions to NO and left
Additions to Yes, along with Data Entry as Yes. HOWEVER, now when I open the
form, the subform not only does not have any records (understandable), but I
cannot enter any records into the subform either--the record navigation
controls are ALL grayed out! What's the problem???? The main form view is
Single Form and the subform view is datasheet.

HELP!!!!
 
D

Danny Lesandrini

Mike, I think you want to set the Allow Edits to true and Data Entry to
False.
 
M

Mike S. S.

Danny, the user basically wants the same input form, but wants to see it in
two modes: 1) Add New Records only; and 2) Edit Old Records only.
Therefore, I can just copy the same form and change the input settings. The
Switchboard entry calls the appropriate form for the Switchboard item I've
entered (i.e., ADD new records, EDIT existing records, etc.). So again, I
need ADD NEW RECORDs form to ONLY allow for adding new records. This is when
the subforms don't allow any entry of records. Everything works fine for the
EDIT OLD RECORDS where I have the settings you recommend. Do you understand
the scenerio and can you help with a solution? Thanks.
 
M

Mike S. S.

Ling, the user basically wants the same input form, but wants to see it in
two modes: 1) Add New Records only; and 2) Edit Old Records only.
Therefore, I can just copy the same form and change the input settings. The
Switchboard entry calls the appropriate form for the Switchboard item I've
entered (i.e., ADD new records, EDIT existing records, etc.). So again, I
need ADD NEW RECORDs form to ONLY allow for adding new records. This is when
the subforms don't allow any entry of records. Everything works fine for the
EDIT OLD RECORDS where I have the settings you recommend. Do you understand
the scenerio and can you help with a solution? Thanks.
 
D

Danny Lesandrini

Mike:

You don't need 2 forms, and that would creage maintenance issues when
changes are needed.

First, I don't think you EVER want to set the Data Entry property to Yes.
That means the form is blank and you can simply add records. I've never
been a fan of using that mode.

You can pass OpenArgs to the form and process them in the Open Event of the
form, something like this ...

Private Sub Form_Open(Cancel As Integer)
On Error Resume Next

Dim strArgs As String

strArgs = Nz(Me.OpenArgs, "")

If strArgs = "" Then
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.AllowEdits = True
ElseIf strArgs = "AddMyRecs" Then
Me.AllowAdditions = True
Me.AllowDeletions = False
Me.AllowEdits = True
ElseIf strArgs = "EditMyRecs" Then
Me.AllowAdditions = False
Me.AllowDeletions = False
Me.AllowEdits = True
End If

End Sub

You will need to decide which properties to set under which conditions. The
OpenArgs is something you pass (last parameter) when calling the
DoCmd.OpenForm method. Just pass any text or number or whatever works for
you. Read it in the OnOpen event and process accordingly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top