subform option group not working

  • Thread starter Thread starter deb
  • Start date Start date
D

deb

Access2003

I have a main form called fClosure (PK ProjectID)
There is a subform called fClosureApproval (PK ClosureApprovalID, SK
ProjectID)

On fClosureApproval, I have an option group with 2 toggle buttons. see code
below
Select Case optApproval.Value
Case 1 'Approve Closure by adding PM and date
Me.ApprovedByMgr = DLookup("[ContactPMgrID]", "[t040Project]",
"[ProjectID] =" & [Forms]![fClosure]![ProjectID])
Me.DateMgr = Now()
Case 2 'Request Clarification by displaying pop up form
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fClosureApproveClarifyPopUp"
stLinkCriteria = "[ClosureApprovalID]=" & Me![ClosureApprovalID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Select

The toggle buttons do not work when I open the main form, fClosure, but if I
open the subform they work ok. How do I change my code to make the subform
form toggle buttons work within fClosure.
 
We see the code but not the event that calls it? We also don't see why you
state "do not work". What happens? Is the code even run? Do you get an error
message that you should share?
 
Don't know what you mean by event that calls. When one of the option buttons
are clicked I wnat it to do what is in the case for that button. when I
click it does nothing.

Hope this is what you are asking for.
--
deb


Duane Hookom said:
We see the code but not the event that calls it? We also don't see why you
state "do not work". What happens? Is the code even run? Do you get an error
message that you should share?

--
Duane Hookom
Microsoft Access MVP


deb said:
Access2003

I have a main form called fClosure (PK ProjectID)
There is a subform called fClosureApproval (PK ClosureApprovalID, SK
ProjectID)

On fClosureApproval, I have an option group with 2 toggle buttons. see code
below
Select Case optApproval.Value
Case 1 'Approve Closure by adding PM and date
Me.ApprovedByMgr = DLookup("[ContactPMgrID]", "[t040Project]",
"[ProjectID] =" & [Forms]![fClosure]![ProjectID])
Me.DateMgr = Now()
Case 2 'Request Clarification by displaying pop up form
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fClosureApproveClarifyPopUp"
stLinkCriteria = "[ClosureApprovalID]=" & Me![ClosureApprovalID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Select

The toggle buttons do not work when I open the main form, fClosure, but if I
open the subform they work ok. How do I change my code to make the subform
form toggle buttons work within fClosure.
 
You can write all the code in the world but it will not do anything unless
it is called/run by some event like a control After Update or form's On
Current or a button's On Click.
Is your code some how attached/called from the After Update of your option
group?

--
Duane Hookom
MS Access MVP

deb said:
Don't know what you mean by event that calls. When one of the option
buttons
are clicked I wnat it to do what is in the case for that button. when I
click it does nothing.

Hope this is what you are asking for.
--
deb


Duane Hookom said:
We see the code but not the event that calls it? We also don't see why
you
state "do not work". What happens? Is the code even run? Do you get an
error
message that you should share?

--
Duane Hookom
Microsoft Access MVP


deb said:
Access2003

I have a main form called fClosure (PK ProjectID)
There is a subform called fClosureApproval (PK ClosureApprovalID, SK
ProjectID)

On fClosureApproval, I have an option group with 2 toggle buttons. see
code
below
Select Case optApproval.Value
Case 1 'Approve Closure by adding PM and date
Me.ApprovedByMgr = DLookup("[ContactPMgrID]", "[t040Project]",
"[ProjectID] =" & [Forms]![fClosure]![ProjectID])
Me.DateMgr = Now()
Case 2 'Request Clarification by displaying pop up form
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fClosureApproveClarifyPopUp"
stLinkCriteria = "[ClosureApprovalID]=" &
Me![ClosureApprovalID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Select

The toggle buttons do not work when I open the main form, fClosure, but
if I
open the subform they work ok. How do I change my code to make the
subform
form toggle buttons work within fClosure.
 
deb said:
Access2003

I have a main form called fClosure (PK ProjectID)
There is a subform called fClosureApproval (PK ClosureApprovalID, SK
ProjectID)

On fClosureApproval, I have an option group with 2 toggle buttons. see
code
below
Select Case optApproval.Value
Case 1 'Approve Closure by adding PM and date
Me.ApprovedByMgr = DLookup("[ContactPMgrID]", "[t040Project]",
"[ProjectID] =" & [Forms]![fClosure]![ProjectID])
Me.DateMgr = Now()
Case 2 'Request Clarification by displaying pop up form
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "fClosureApproveClarifyPopUp"
stLinkCriteria = "[ClosureApprovalID]=" & Me![ClosureApprovalID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Select

The toggle buttons do not work when I open the main form, fClosure, but if
I
open the subform they work ok. How do I change my code to make the
subform
form toggle buttons work within fClosure.
 
Back
Top