Hi
My database launches SelecProfile_Form when it starts.
Then i run this code
When double clicking on a listbox row.
Then my profile_form opens
Then i run this code
and directly this code
and this code
then i run the first code again (double click the listbox)
and i get this error message
screenshot: http://prntscr.com/he4jkc
Error 3075 SYNTAXERROR on profile_id
If i go to the code, excel highligths this row
i only get this error if i go from form selectprofile_form opens a profile to profile_form
go the button that opens undervisningstid_form
close that form and then close profile_form
and try to open the profile again.
if i skip opening undervisningstid_form i do not get this error atall.
Please help me find the error so i can correct it.
If you want my project file, let me know and ill upload it.
My database launches SelecProfile_Form when it starts.
Then i run this code
Code:
Application.Echo False
If Form_SelectProfile_Form.Dirty Then Form_SelectProfile_Form.Dirty = False
If Not IsNull(Form_SelectProfile_Form.txtProfile_ID) Then
DoCmd.OpenForm "Profile_Form", , , "Profile_ID = " & Form_SelectProfile_Form.ListPicker
End If
If Me.Dirty Then Me.Dirty = True
DoCmd.Close acForm, Me.Name
ProfileEffects_Read
Application.Echo True
Then my profile_form opens
Then i run this code
Code:
Private Sub TjanstFordelning_Button_Click()
Application.Echo False
If Me.Dirty Then Me.Dirty = False
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "UndervisningsTid_Form"
Form_SelectProfile_Form.ListPicker.Requery
Application.Echo True
End Sub
Code:
Private Sub txtCloseSave_Button_Click()
Application.Echo False
If Me.Dirty Then Me.Dirty = True
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "Profile_Form"
Forms!Profile_Form.Requery
Application.Echo True
End Sub
Code:
Private Sub Close_button_Click()
Application.Echo False
If Me.Dirty Then Me.Dirty = False
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm "SelectProfile_Form"
Form_SelectProfile_Form.ListPicker.Requery
Application.Echo True
End Sub
then i run the first code again (double click the listbox)
and i get this error message
screenshot: http://prntscr.com/he4jkc
Error 3075 SYNTAXERROR on profile_id
If i go to the code, excel highligths this row
Code:
Private Sub ListPicker_DblClick(Cancel As Integer)
Application.Echo False
If Form_SelectProfile_Form.Dirty Then Form_SelectProfile_Form.Dirty = False
If Not IsNull(Form_SelectProfile_Form.txtProfile_ID) Then
[I][B]DoCmd.OpenForm "Profile_Form", , , "Profile_ID = " & Form_SelectProfile_Form.ListPicker[/B][/I]
End If
If Me.Dirty Then Me.Dirty = True
DoCmd.Close acForm, Me.Name
ProfileEffects_Read
Application.Echo True
End Sub
i only get this error if i go from form selectprofile_form opens a profile to profile_form
go the button that opens undervisningstid_form
close that form and then close profile_form
and try to open the profile again.
if i skip opening undervisningstid_form i do not get this error atall.
Please help me find the error so i can correct it.
If you want my project file, let me know and ill upload it.