Start at new record

imright

Registered User.
Local time
Today, 00:34
Joined
Jun 27, 2008
Messages
30
On my startup form I've put a command button to open form. The form that I'm opening is set up to autonumber each new form. My question is how do I set it up so when the button is activated it goes to a new form with the sequential next number instead of opening to the first form?:eek:
 
See if the DataMode argument of OpenForm does what you want.
 
All I know is some real basic requirements of Access so I'll need a little more detail please and I don't know VBA. I'm also running Access 2003 if it makes a difference.
I couldn't find the OpenForm any where. I looked in the properties box and the code box but nothing.
Once I find the OpenForm what would the DataMode argument be?
 
In the properties of the button on the event tab I suspect you'll see "Event Procedure" in the click line. Click on the ellipsis (...) to the right. That should take you into the VBA editor. Put the cursor on OpenForm and hit F1, which should bring you into help for that method. You should see the options available there.
 
Sorry I haven't gotten back sooner but busy weekend and just now getting on computer.
I went to the Event Procedure of On Enter and then into the VBA editor. This is what I have, hopefully you can lead me into the correct direction because I don't see OpenForm.
Private Sub List6_DblClick(Cancel As Integer)

End Sub

Private Sub List8_DblClick(Cancel As Integer)

End Sub

Private Sub ICAR_Form_Enter()

End Sub

Private Sub TabCtl0_Change()
DoCmd.Maximize
End Sub
Private Sub ICAR_Form_Click()
On Error GoTo Err_ICAR_Form_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "ICAR_Table"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_ICAR_Form_Click:
Exit Sub

Err_ICAR_Form_Click:
MsgBox Err.Description
Resume Exit_ICAR_Form_Click

End Sub
 
Now that I've just posted I see the OpenForm and I did go to help but since I don't know VBA, I'm not sure what to do next. Should I try Acformopendatamode?
 
Now that I've just posted I see the OpenForm and I did go to help but since I don't know VBA, I'm not sure what to do next. Should I try Acformopendatamode?

If you go to the VBA window and then put your cursor in this:

DoCmd.OpenForm stDocName, , , stLinkCriteria


and if you delete one comma and then put it back the intellisense will show you what goes in what spots.
 
I did that and got a very long string as follows OpenForm(FormName,[ViewAsACForm=AcNormal],[Filtername],[wherecondition],[Datamode as AcFormOpen Data Mode=AcFormProperty Settings],[WindowMode as AcWindowMode=AcWindowNormal],[OpenArgs])
Should I input the form name and filtername? Anything else? What would the filtername be?
 
From Help:

You can leave an optional argument blank in the middle of the syntax, but you must include the argument's comma

So you would only input arguments you want to use. Obviously form name is important, but based on what you're trying to do you would not put anything in the filter argument.
 
I've tried playing with this but continue to get an error, as I said before VBA is a not my cup of tea and is very foreign to me. I tried changing to the form name and using Openargs and LastForm but only errors.
Could you be a little more specific in what I need to input?
 
DoCmd.OpenForm "FormName", , , , acFormAdd
 
Worked great, thanks for the help. I'll be posting more as I progress in this database.
 

Users who are viewing this thread

Back
Top Bottom