Code Gurus...

ghs215
07-27-2001, 09:40 AM
Access97 Code.
Here is my code. The Button is suppost to look at the option group and depending on the option that is selected, to do the following code on the if then statement. Please tell me what im missing to make this happen.



Option Compare Database
Option Explicit

Private Sub Command41_Click()

If Option29 Then
[Forms]![_QE_DATA_1_SD]![D_Plan_Tech_Def_Cmplt] = Me![New_Date]
ElseIf Option31 Then
[Forms]![_QE_DATA_1_SD]![D_Plan_Est_Cmplt] = Me![New_Date]
ElseIf Option33 Then
[Forms]![_QE_DATA_1_SD]![D_Plan_To_Contracts_SI] = Me![New_Date]
ElseIf Option35 Then
[Forms]![_QE_DATA_1_SD]![D_Plan_T0_Cust] = Me![New_Date]
End If

End Sub

Private Sub Frame26_AfterUpdate()
Select Case Frame26
Case 1 'Option box 29
[State_Changed] = "Plan Technical Definition Complete"
Me![Old_Date] = [Forms]![_QE_DATA_1_SD]![D_Plan_Tech_Def_Cmplt]
Me![QE_Number] = [Forms]![_QE_DATA_1_SD]![QE_Number]
Me![Tech_Focal] = [Forms]![_QE_DATA_1_SD]![Tech Focal]
Me![Description] = [Forms]![_QE_DATA_1_SD]![Description]
Me![Date_State_Changed] = [Forms]![_QE_DATA_1_SD]![QE_State_Text]


Case 2 'Option box 31
[State_Changed] = "Plan Estimation Complete"
Me![Old_Date] = [Forms]![_QE_DATA_1_SD]![D_Plan_Est_Cmplt]
Me![QE_Number] = [Forms]![_QE_DATA_1_SD]![QE_Number]
Me![Tech_Focal] = [Forms]![_QE_DATA_1_SD]![Tech Focal]
Me![Description] = [Forms]![_QE_DATA_1_SD]![Description]
Me![Date_State_Changed] = [Forms]![_QE_DATA_1_SD]![QE_State_Text]


Case 3 'Option Box 33
[State_Changed] = "Plan to Contracts SI"
Me![Old_Date] = [Forms]![_QE_DATA_1_SD]![D_Plan_To_Contracts_SI]
Me![QE_Number] = [Forms]![_QE_DATA_1_SD]![QE_Number]
Me![Tech_Focal] = [Forms]![_QE_DATA_1_SD]![Tech Focal]
Me![Description] = [Forms]![_QE_DATA_1_SD]![Description]
Me![Date_State_Changed] = [Forms]![_QE_DATA_1_SD]![QE_State_Text]


Case 4 'Option Box 35
[State_Changed] = "Plan to Customer"
Me![Old_Date] = [Forms]![_QE_DATA_1_SD]![D_Plan_T0_Cust]
Me![QE_Number] = [Forms]![_QE_DATA_1_SD]![QE_Number]
Me![Tech_Focal] = [Forms]![_QE_DATA_1_SD]![Tech Focal]
Me![Description] = [Forms]![_QE_DATA_1_SD]![Description]
Me![Date_State_Changed] = [Forms]![_QE_DATA_1_SD]![QE_State_Text]


Case Else 'Whoops something wrong
MsgBox "You clicked an option that I don't Know about", vbInformation, "Error"

End Select

End Sub

Private Sub Command39_Click()
On Error GoTo Err_Command39_Click


Screen.PreviousControl.SetFocus
DoCmd.FindNext

Exit_Command39_Click:
Exit Sub

Err_Command39_Click:
MsgBox Err.Description
Resume Exit_Command39_Click

End Sub

Thinker
07-27-2001, 09:51 AM
I already gave it a shot on your previous post. But you aren't explaining enough to know how to help you anymore.

ghs215
07-27-2001, 10:53 AM
I get an error message telling me that there is no value. The If then else is attached to a button and when it is pressed it should place the value in the [New_Date] field to another form Named on of the four in the If then Else statement. Depending on which Option button has been selected. I dont know what elsed the code that contains the if then else statement needs to do this.

kcwallace
07-27-2001, 01:09 PM
I am assuming frame26 contains Option29 - Option35. If so change Private Sub Command41_Click() to:

If Me!Frame26 = 1 Then
[Forms]![_QE_DATA_1_SD]![D_Plan_Tech_Def_Cmplt] = Me![New_Date]
ElseIf Me!Frame26 = 2 Then
[Forms]![_QE_DATA_1_SD]![D_Plan_Est_Cmplt] = Me![New_Date]
ElseIf Me!Frame26 = 3 Then
[Forms]![_QE_DATA_1_SD]![D_Plan_To_Contracts_SI] = Me![New_Date]
ElseIf Me!Frame26 = 4 Then
[Forms]![_QE_DATA_1_SD]![D_Plan_T0_Cust] = Me![New_Date]
End If

ghs215
07-27-2001, 01:39 PM
AWSOME!!!!Thanks Very Much.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum