Still working on bee hives..... Still converting to VBA.......
Stuck on something that should be simple and yet, I can't get it to work.
Using code that is virtually identical to code used with another set of forms that works fine. Obviously form and control names are adjusted.
With this form however, the code keeps bugging out. I have verified form name, control names, the controls being on the forms, etc. multiple times.
The stop is on the DoCmd.OpenForm line and it happens regardless of whether it's the Then condition or the Else condition.
Here is the code:
What am I missing ?? I uploaded the file again. The offending event is when the F_Log_Hive_Main form is open and attempting to open another form using the De-Activate Hive button.
Code:Private Sub Command_Status_Change_Click() If Forms!F_Log_Hive_Main!Status = -1 Then 'Opens the Status Change form to De-Activate Hives - No other options DoCmd.OpenForm "F_Log_Hive_Status_Change", acNormal, "", "Apiary_Active = -1 And If Forms!F_Log_Hive_Main!Combo_Filter_by_Apiary.Column(1) > 1 Then Log_Apiary_ID = Forms!F_Log_Hive_Main!Combo_Filter_by_Apiary.Column(1)", acFormReadOnly, acDialog Forms!F_Log_Hive_Status_Change!Status_Change_Title.Caption = "De-Activate Hive" 'Change form Title Forms!F_Log_Hive_Status_Change!Command_Return_to_Log.Caption = "Return to" & vbCrLf & "In-Active Log" 'Changes Button Text Forms!F_Log_Hive_Status_Change!Command_Change_Status.Caption = "De-Activate" 'Changes Row Button Text Forms!F_Log_Hive_Status_Change!Note_Reactivate.Visible = 0 Forms!F_Log_Hive_Status_Change!Note_Deactivate.Visible = -1 Forms!F_Log_Hive_Status_Change!Note_Move.Visible = 0 Forms!F_Log_Hive_Status_Change!Note_Delete.Visible = 0 Forms!F_Log_Hive_Status_Change!Action_Mode = -1 Forms!F_Log_Hive_Status_Change!Move_Mode = 0 Forms!F_Log_Hive_Status_Change!Delete_Mode = 0 Else 'Opens the Status Change form to Re-Activate Hives - No other options DoCmd.OpenForm "F_Log_Hive_Status_Change", acNormal, "", "Apiary_Active = 0", "acFormReadOnly", acDialog Forms!F_Log_Hive_Status_Change!Status_Change_Title.Caption = "Re-Activate Hive" 'Change form Title Forms!F_Log_Hive_Status_Change!Command_Return_to_Log.Caption = "Return to" & vbCrLf & "Active Log" 'Changes Button Text Forms!F_Log_Hive_Status_Change!Command_Change_Status.Caption = "Re-Activate" 'Changes Row Button Text Forms!F_Log_Hive_Status_Change!Note_Reactivate.Visible = -1 Forms!F_Log_Hive_Status_Change!Note_Deactivate.Visible = 0 Forms!F_Log_Hive_Status_Change!Note_Move.Visible = 0 Forms!F_Log_Hive_Status_Change!Note_Delete.Visible = 0 Forms!F_Log_Hive_Status_Change!Action_Mode = 0 Forms!F_Log_Hive_Status_Change!Move_Mode = 0 Forms!F_Log_Hive_Status_Change!Delete_Mode = 0 End If End Sub