Opening a Form and Changing It/Running a Procedure

  • Thread starter Thread starter LA Lawyer
  • Start date Start date
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
 
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
 
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.
 
Back
Top