hello
i have a button in a form that i wrote the below code in it and then based on two date text boxes a form will be APPEARED. when there are related dates within the query they will be shown but when there are not related data the form will be completely empty. do you know why? can you help me please? i also attached the difference between status of my form . i want that just the data of the form will be empty but my text boxes and buttons won't be disappeared. thank you
i have a button in a form that i wrote the below code in it and then based on two date text boxes a form will be APPEARED. when there are related dates within the query they will be shown but when there are not related data the form will be completely empty. do you know why? can you help me please? i also attached the difference between status of my form . i want that just the data of the form will be empty but my text boxes and buttons won't be disappeared. thank you
Code:
Dim vAdmin_Flag As Boolean
Dim vAnalyser_Flag As Boolean
Dim vReadOnly_Flag As Boolean
If Get_Bearbeiter_Detail(fOSUserName, , vReadOnly_Flag, vAnalyser_Flag, vAdmin_Flag) = True Then
If vAdmin_Flag = True Or vAnalyser_Flag = True Then
DoCmd.OpenForm "frm_Bearbeiten_I_FAST", , , "Datum_Bewegung BETWEEN #" & Replace(Format(Me.txt_StartDate.Value, "mm/dd/YYYY"), ".", "/") & "# " & _
"AND #" & Replace(Format(Me.txt_EndDate.Value, "mm/dd/YYYY"), ".", "/") & "#"
ElseIf vReadOnly_Flag = True Then
DoCmd.OpenForm "frm_Bearbeiten_I_FAST", , , "Datum_Bewegung BETWEEN #" & Replace(Format(Me.txt_StartDate.Value, "mm/dd/YYYY"), ".", "/") & "# " & _
"AND #" & Replace(Format(Me.txt_EndDate.Value, "mm/dd/YYYY"), ".", "/") & "#"
[Forms]![frm_Bearbeiten_I_FAST]![Bereich].Enabled = False
[Forms]![frm_Bearbeiten_I_FAST]![Prozess].Enabled = False
[Forms]![frm_Bearbeiten_I_FAST]![Ursache].Enabled = False
[Forms]![frm_Bearbeiten_I_FAST]![Kommentar].Enabled = False
[Forms]![frm_Bearbeiten_I_FAST]![Status].Enabled = False
[Forms]![frm_Bearbeiten_I_FAST]![Verantwortlicher].Enabled = False
[Forms]![frm_Bearbeiten_I_FAST]![btn_TeilenummerGeschichte].Enabled = False
[Forms]![frm_Bearbeiten_I_FAST]![btn_Ursachenanalysen].Enabled = False
[Forms]![frm_Bearbeiten_I_FAST]![btn_ÜbernehmenFürAlle].Enabled = False
End If
Else
MsgBox "Sie sind leider nicht berechtigt diese Funktion auszuführen!", vbCritical
DoCmd.Close acForm, "frm_Bearbeiten_I_FAST"
End If