PDA

View Full Version : Access DB - Make me look like a fool!


Dymetrie
05-03-2009, 11:53
AAAARGH!

Slightly stuck with an Access DB, on something that I know how to do and have done before but now can't figure out...

Does anyone know how I make a form open with a new record rather than at 'record 1'?

It's really getting on my nerves now :(

Thanks in advance to whomever it is that makes me look like a fool :D

Dym

Feek
05-03-2009, 14:14
My DBA said "Open it as an insert rather than a query"

Then he said "Tell him GIYF, that's a stupid question"

Dymetrie
05-03-2009, 14:36
It's not opening as a query, the command link merely opens the form...

The other DB I have opens as a new record, but despite trying to figure out what's different between the two I'm stumped :/

I am also stumped by that acronym :D

Dymetrie
05-03-2009, 14:42
If it's any help, this is the VB code...

Private Sub Visit_Logging_Click()
On Error GoTo Err_Visit_Logging_Click

Dim stDocName As String
Dim stLinkCriteria As String

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

Exit_Visit_Logging_Click:
Exit Sub

Err_Visit_Logging_Click:
MsgBox Err.Description
Resume Exit_Visit_Logging_Click

Burble
05-03-2009, 14:43
I am also stumped by that acronym :D

GIYF = Google Is Your Friend.

I'm very very rusty with Access but am sure I've done this before. Lemme see if I still have copies of the old stuff.

Dymetrie
05-03-2009, 15:58
Ok, so the DB which does work has a macro to create a new record, I just can't figure out where it kicks in...

This is most perturbing now :(

Dymetrie
05-03-2009, 16:17
AHA!

Finally found something which actually works :D

Have changed the code to:

Private Sub Visit_Logging_Click()
On Error GoTo Err_Visit_Logging_Click

Dim stDocName As String
Dim stLinkCriteria As String

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

Exit_Visit_Logging_Click:
Exit Sub

Err_Visit_Logging_Click:
MsgBox Err.Description
Resume Exit_Visit_Logging_Click

Will find out if that borks everything when I need to use the DB tomorrow morning :p