main form and popup

J

John

I have a main form with a status button on it. The status button
works fine and does what it is to do. Part of it is opening a popup
form (modal, popup). On the popup is a SEND button. The code for it
is below. On the mainform is a txtbox for status. In the code below
is a call to a change status routine. This ChangeStatus is on the
main form and is used alot there so it needs to stay as part of the
main form. How can I call it from the SEND button of the popup?

Private Sub cmdRequestApprovalSend_Click()

Dim sql As String

sql = "POSendApprovalRequest " & Forms![Purchase Orders].PONumber
& ", '" & txtRequestApprovalDescription & "' "
Call RunSQLServerStoredProcedure(sql)

DoCmd.Close

Call ChangeStatus(PO_STATUS_REQUEST_APPROVAL_SENT)

End Sub


Thanks....John
 
J

John

I have a main form with a status button on it.  The status button
works fine and does what it is to do.  Part of it is opening a popup
form (modal, popup).  On the popup is a SEND button.  The code for it
is below.  On the mainform is a txtbox for status.  In the code below
is a call to a change status routine.  This ChangeStatus is on the
main form and is used alot there so it needs to stay as part of the
main form.  How can I call it from the SEND button of the popup?

Private Sub cmdRequestApprovalSend_Click()

    Dim sql As String

    sql = "POSendApprovalRequest " & Forms![Purchase Orders].PONumber
& ", '" & txtRequestApprovalDescription & "' "
    Call RunSQLServerStoredProcedure(sql)

    DoCmd.Close

    Call ChangeStatus(PO_STATUS_REQUEST_APPROVAL_SENT)

End Sub

Thanks....John



I might have gotten it working right. I used Call Forms("Purchase
Orders").ChangeStatus(PO_STATUS_REQUEST_APPROVAL_SENT) and it seems to
be working like it should. If you read this and think otherwise, feel
free to let me know.
Thanks...John
 
M

Marshall Barton

John said:
I have a main form with a status button on it.  The status button
works fine and does what it is to do.  Part of it is opening a popup
form (modal, popup).  On the popup is a SEND button.  The code for it
is below.  On the mainform is a txtbox for status.  In the code below
is a call to a change status routine.  This ChangeStatus is on the
main form and is used alot there so it needs to stay as part of the
main form.  How can I call it from the SEND button of the popup?

Private Sub cmdRequestApprovalSend_Click()

    Dim sql As String

    sql = "POSendApprovalRequest " & Forms![Purchase Orders].PONumber
& ", '" & txtRequestApprovalDescription & "' "
    Call RunSQLServerStoredProcedure(sql)

    DoCmd.Close

    Call ChangeStatus(PO_STATUS_REQUEST_APPROVAL_SENT)

End Sub

I might have gotten it working right. I used Call Forms("Purchase
Orders").ChangeStatus(PO_STATUS_REQUEST_APPROVAL_SENT) and it seems to
be working like it should. If you read this and think otherwise, feel
free to let me know.


That's the standard way to do that. Using Call is optional:

Forms("Purchase Orders").ChangeStatus _
PO_STATUS_REQUEST_APPROVAL_SENT

Either way works because a public Function in a class module
is a method (property get) of the class. If you are not
going to use the result of the function, you can call it as
if it were a Sub procedure.
 

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