DebbieCoates
Programmer
i have various forms in my database that as I select a project, will fill all the field on the form.
Rather than writing
FieldA= ""
FieldB= ""
FieldC= ""
FieldD= ""
etc etc
everytime I have to clear the form, I thought I would write a function, where I passed in the form name, and then clear the fields, sort of like this
Public Sub ClearForm(strFormName As String)
Select Case "strFormName"
Case "frm_Main":
frm_Main.fieldA= ""
frm_Main.fieldB= ""
frm_Main.FfieldC= ""
Case "AnotherForm":
AnotherForm.fieldA= ""
AnotherForm.fieldA= ""
AnotherForm.fieldA= ""
End Select
End Sub
and then from the calling form
Call ClearForm(me.name)
for some reason the me.name, although is the name of the form, doesn't pass it to the clearform sub because it doesn't recognise it in the select case statement
can anyone give me a clue as to why it is doing this
Many Thanks
Rather than writing
FieldA= ""
FieldB= ""
FieldC= ""
FieldD= ""
etc etc
everytime I have to clear the form, I thought I would write a function, where I passed in the form name, and then clear the fields, sort of like this
Public Sub ClearForm(strFormName As String)
Select Case "strFormName"
Case "frm_Main":
frm_Main.fieldA= ""
frm_Main.fieldB= ""
frm_Main.FfieldC= ""
Case "AnotherForm":
AnotherForm.fieldA= ""
AnotherForm.fieldA= ""
AnotherForm.fieldA= ""
End Select
End Sub
and then from the calling form
Call ClearForm(me.name)
for some reason the me.name, although is the name of the form, doesn't pass it to the clearform sub because it doesn't recognise it in the select case statement
can anyone give me a clue as to why it is doing this
Many Thanks