Need help creating dynamic 'Help' pop-up form with OpenForm function

jmatthews89

New member
Local time
Today, 17:03
Joined
Mar 24, 2011
Messages
2
This forum has answered every other Access question I've ever had, but I've been banging my head against the wall about this very simple problem I'm having - so here goes! (Using Access 2007 for a work project)

Background: I have one main form [frmCompany] which contains two subforms, the relevant one being [frmMain]. FrmMain is like a scoresheet which users will use to calculate a total score by following the steps of an evaluation scheme. In reality they only need to enter one number for each of the 7 'factors' to be given their score. But lets say the user isn't sure what to enter for one of the factors, "Am I an 8 or a 9?" - I need to be able to have a dynamic 'help' form which pops up and shows the user descriptions of all the possible scores for that factor - essentially a page with seven memo fields on it. I have already set up the help 'pop up' form ([frmHELP]) to open when the user clicks a "?" label next to each part of the scorecard in the subform [frmMain].

The problem: Even though I can get [frmHELP] to open, I'm not sure how I go about getting the pop-up form to fill the seven fields with different values based on which factor the user wanted to get help on. I know that one way is to just create seven different pop-up forms, but I'm hoping to have a solution that is easily-updatable and uses memo fields in an underlying table.

My original thought was something like this:
- User clicks lblHELP1.
- In OnClickEvent:
Private Sub lblHELP1_Click()
On Error GoTo Err_lblHELP1_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmHELP"
DoCmd.OpenForm stDocName, , , stLinkCriteria

'THERE NEEDS TO BE A CODE HERE THAT TELLS THE FORM TO ONLY OPEN THE RECORD WHERE A TEXT BOX BOUND TO A TABLE WITH ONLY SEVEN RECORDS POINTS TO RECORD X. I WILL REPEAT THIS CODE IN THE ONCLICK PROPERTY FOR EACH OF THE SEVEN LABELS/BUTTONS


Exit_lblKNOWhelp_Click:
Exit Sub
Err_lblKNOWhelp_Click:
MsgBox Err.Description
Resume Exit_lblKNOWhelp_Click
End Sub
Is making seven separate forms the only/easiest way to do this?

Thank you in advance for your help!
 
Worked like a charm! My attempts had gone wrong when I tried to create an elaborate reference to the control on the subform when in reality the command knows what form the control is on and all that is needed is 'me.controlname' - thank you for sending such easy-to-understand instructions!
 
Glad it helped, and welcome to the site by the way!
 

Users who are viewing this thread

Back
Top Bottom