Closing and open Form whilst linking the correct record being open

C

Confused87

I want to close the open form when clicking away using the command button -
however, I want to open onto a linked record - where in the following code do
I do that?


Private Sub OpenAssetsBtn_Click()

On Error GoTo ErrHandler

DoCmd.OpenForm "frmAssets"
DoCmd.Close acForm, Me.Name

Exit Sub

ErrHandler:

MsgBox "Error in OpenAssetsBtn_Click( ) in " & Me.Name & " form." & _
vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & Err.Description
Err.Clear

End Sub

____________
OpenAssetsBtn = button
frmAssets = form to open

the linking is called
New ID 2
in the form I want to open and
associated member
in the form I am closing.

Does anyone know where I can get some basic info in how to build code, I've
been doing it in a very cut and paste way to date and would like a really
clear guide - any ideas?

Cheers
C
 
C

Confused87

Thanks PieterLinden, but unfortunatly my knowledge is VERY basic. Could you
give me some more detailed information or refer me to a good guide which will
tell me what all that means?

Many Thanks
C
 

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