[mso] Re: Access VC setting Variables

  • From: "Colli, Anthony G" <Anthony.Colli@xxxxxxx>
  • To: "'mso@xxxxxxxxxxxxx'" <mso@xxxxxxxxxxxxx>
  • Date: Wed, 8 Jan 2003 15:53:03 -0500

April-

You need to reference the variable like: Forms!frmClientInfo.WhatDoctor

If Forms!frmClientInfo.WhatDoctor = "Primary" Then

'do stuff

You also need to declare WhatDoctor as a public variable like 

Option Compare Database
Option Explicit
Public WhatDoctor As String

-Anthony


-----Original Message-----
From: April Pace [mailto:4office@xxxxxxxxxxxxx]
Sent: Wednesday, January 08, 2003 11:29 AM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Access VC setting Variables



Anthony, Thanks the requery command works!!!

Can you figure out though why my variable can not be "read" from one form
module to another??

-----Original Message-----
Behalf Of Colli, Anthony G

Forms!frmClientInfo.cboDrPriID.Requery will do just that.

-Anthony

----------------------------------------------------

In my frmClientInfo in VB at the top I have the following:

Option Compare Database
Option Explicit
Dim WhatDoctor As String

Then in below it I have:

Private Sub cboDrPriID_BeforeUpdate(Cancel As Integer)


If Me.txtDrPriID.Value = 1 Then 'meaning they chose the Add New Doctor

WhatDoctor = "Primary"

Then the rest of the procedure will open (pop-up) the sfrmDrInfo form, so
they can create the new doctor... when the user hits the close button I have
the following code:

Private Sub CommandCloseDr_Click()
On Error GoTo Err_CommandCloseDr_Click
If WhatDoctor = "Primary" Then

    Me.txtCltDrID.SetFocus            'set the focus on the form to Dr's ID
    Forms!frmClientInfo.txtCltDrPriID = Me.txtCltDrID 'set the value of Dr's
Primary ID

ElseIf WhatDoctor = "Secondary" Then

    Me.txtCltDrID.SetFocus            'set the focus on the form to Dr's ID
    Forms!frmClientInfo.txtCltDrsecID = Me.txtCltDrID 'set the value of Dr's
Primary ID

End If


    DoCmd.Close
Exit_CommandCloseDr_Click:
    Exit Sub

Err_CommandCloseDr_Click:
    MsgBox Err.Description
    Resume Exit_CommandCloseDr_Click

End Sub

When this code is run it keeps finding the WhatDoctor Variable empty...


Can somebody PLEASE help me...

April


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx?Subject=unsubscribe

Or, visit the group's homepage and use the dropdown menu.  This will also
allow you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation
with instructions.  Once you are a member of the files group, you can go
here to upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx?Subject=unsubscribe

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: