By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,863 Members | 879 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,863 IT Pros & Developers. It's quick & easy.

What is quicker or better?

P: n/a
Hi all,

I have a access 2000 database with linked tables to a access 2000 backend
database. The performance is really slow. I am looking for the best way
to open a form to add a new record without retrieving the full dataset.
In my sample below I have two options I could think of, is there any
important difference? Which one is better or quicker to use? Am I on the
right track?

Thanks and sorry for being a newbie.

Private Sub cmdObservationRecords_Click()
On Error GoTo Err_cmdObservationRecords_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmObservation"
DoCmd.OpenForm stDocName, , , stLinkCriteria
' -- Option 1 --

Forms!frmObservation.DataEntry = True

' -- Option 2 --

' DoCmd.GoToRecord acDataForm, stDocName, acNewRec
Exit Sub

MsgBox Err.Description
Resume Exit_cmdObservationRecords_Click

End Sub
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
I would say both of those approach are going to be not very good, and both
will probably be about the same.

I would actually open the form in add mode, so the form goes right to a new

In both of your examples, you first load the form. and THEN go jump into add

Also, you have declared a variable stLinkCritiera and you never use it. I
would suggest you dump that stuff that you never use.

Anyway, as mentioned, I would jump the form right into add mode.

Hence, I would use:
Dim stDocName As String

stDocName = "frmObservation"
DoCmd.OpenForm "OpenForm",,,,acFormAdd

If you only want the user to enter ONE record, then I would turn off the
forms "allow additions", as then the above will only over ride that setting
for one record (which is ideal). I would also suggest that you set the forms
cycle property to current record, and thus the tab key will go round and
round in the current screen, and not jump to a new records (this also
applies to the page up/down keys, and also the mouse wheel).

Albert D. Kallal (MVP)
Edmonton, Alberta Canada

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.