View Single Post
  #4  
Old January 31st, 2010, 12:43 AM posted to microsoft.public.access.forms
GeoffK
external usenet poster
 
Posts: 12
Default command button to open 1 of 2 forms

Arvin,
I have been trying to get your suggestion to work but get compile errors I
think this may be because I am using this on 2 different forms and your code
is for 1 form.

("Customer_Create" to input the customers details including the checkbox and
"Daily_Route" to select the required customer then press command "update" to
take me to the appropriate Customer)


"Arvin Meyer [MVP]" wrote:

Sure, you can even change the button caption and what happens in the click
event based upon the check box. Use the AfterUpdate event of the check box
to change the caption. the use the form's Current event to call it between
records.

Sub chkWhatever_AfterUpdate()
If Me.chkWhatever = True Then
Me.cmdOpen.Caption = "ServiceCall"
Else
Me.cmdOpen.Caption = "Installation"
End If
End Sub

In the form's Current event use:

Sub Form_Current()
chkWhatever_AfterUpdate
End Sub

And in the button's click event:

Sub cmdOpen_Click()
If Me.chkWhatever = True Then
DoCmd.OpenForm "ServiceCall"
Else
DoCmd.OpenForm "Installation"
End If
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"GeoffK" wrote in message
...
Hi All,

I have 3 forms "DailyRoute", "ServiceCall" and "Installation".
"ServiceCall" and "Installation" have control source as "TblCustomers"
when
the customer details are entered a checkbox is check to identify a Service
Call, the issue is that different information is required for each job
type
("ServiceCall" or "Installation") therefore I require 2 forms for closing
the
days work.

Is it possible to click the "update" command button in "DailyRoute" and
display either "ServiceCall" or "Installation" forms depending on the
checked
box.

Thanking you in advance
GeoffK



.