Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sub Form Problem

Status
Not open for further replies.

rumples

Technical User
Sep 6, 2004
5
US
How do I get the code below to work?

what I have is a switch board that has 3 command buttons (see code below) Ehen you click on one of the 3 commands it will take me to another form (frmDisclaimer) see below code

---------------------------------------
Private Sub btnOpenCaseMgrs_Click()
DoCmd.Close
DoCmd.OpenForm "frmDisclaimer"
End Sub

Private Sub btnOpenMemRep_Click()
DoCmd.Close
DoCmd.OpenForm "frmDisclaimer"
End Sub

Private Sub btnOpenOrg_Click()
DoCmd.Close
DoCmd.OpenForm "frmDisclaimer"
End Sub

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

On the form disclaimer form there is a command button called the btnBegin. When you click on the Begin button it should take one to the of the form disclaimer it takes me to the "frmEntrySelfAssesmentCaseManagers"
for all 3 survey's. What it should do is if I click on the OpenMemberRep or OpenOrg command it will take me to that paticular survey, instead it takes me to the OpenCaseManagers survey each time. See that code below.

Thanks

Option Compare Database

Private Sub btnBegin_Click()
DoCmd.Close
DoCmd.OpenForm "frmEntrySelfAssessmentCaseManagers"

End Sub


Private Sub btnBegin_Click()
DoCmd.Close
DoCmd.OpenForm "frmMemberRepresenativesOutreachSpecialtist"

End Sub


Private Sub btnBegin_Click()
DoCmd.Close
DoCmd.OpenForm "OrganizationalAssesmentofCulturalCompetence"

End Sub

 
Why do you have the three buttons in the switchboard going to the same form?
 
Answering ALEESJAY's question

The reason for three buttons going to the same form is because before they enter the survey there is a form (disclaimer that talks about what the survey is about. from the disclaimer form you click on Take Survey. That is where I am having the problem, So it looks like this
step 1) You enter the switchboard
step 2) Click on appropiate survey to take
step 3) Disclaimer form pops up
step 4) From the disclaimer form I want the user to see the appropiate survey they clicked on from step 2.
 
You might want to do it a little differently. For example, maybe have the user select the appropraite survey from an option group. From the AfterUpdate event of that option group, or from an "OPEN" button click event, run a Select Case statement to evaluate which survey is selected and open the appropriate form.

If each survey requires a different disclaimer form, then also design your disclaimer form to show the appropriate text according to which option is selected in the option group.

Mike Dorthick
 
You might try setting the PopUp and modal properties of the Disclaimer form to YES, and calling both form from the switchboard

Private Sub btnOpenCaseMgrs_Click()
DoCmd.Close
DoCmd.OpenForm "frmDisclaimer"
DoCmd.openForm "Form1"
End Sub

Private Sub btnOpenMemRep_Click()
DoCmd.Close
DoCmd.OpenForm "frmDisclaimer"
DoCmd.openForm "Form2"
End Sub

Private Sub btnOpenOrg_Click()
DoCmd.Close
DoCmd.OpenForm "frmDisclaimer"
DoCmd.openForm "Form3"
End Sub

Both Forms will open but you cant work on the second form until the disclaimer is closed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top