subform option group not working

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.
 
D

Duane Hookom

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?
 
D

deb

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.
 
D

Duane Hookom

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.
 
D

De Jager

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top