Opening a Form and Changing It/Running a Procedure

L

LA Lawyer

I want to open a form (which I know how to do) and then (1) change some of
its default data and (2) run a procedure in that form. The procedure is
already a named procedure in the form to be opened.

How is that done?

This is what I have already:

DoCmd.OpenForm "LetterOptionsForm", , , "PersonID=" & PersonID
With Screen.ActiveForm
!POSSigner.Value = UserFirstName
!FaxOnly.Value = True
' Here I want to run the procedure called "DoAFax"
End With
 
A

Arvin Meyer [MVP]

You almost have it:

DoCmd.OpenForm "LetterOptionsForm", , , "PersonID=" & PersonID
With Screen.ActiveForm
!POSSigner.Value = UserFirstName
!FaxOnly.Value = True
DoAFax ' Sub
' Call DoAFax() ' Function
End With
 
L

LA Lawyer

I did try your suggestion, but Access 2007 is telling me that this is an
undefined function or procedure; obviously, it is looking into the current
form and not the LetterOptionsForm which is being opened. Your suggestion
seems to be right since the command is between with...end with, but it not
work. I also tried it with a "call" before it (even though this is a
procedure), and that didn't work any differently.
 

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