I have been having a strange problem when translating a command buttons code into a subroutine in the global code so it can be reused.
I had a piece of code that would take the values from a series of unbound elements and create a new record in a subform and insert those values with some hidden key fields. When I translated it to the global code I changed the program to use parameters instead of layout element names and variables for the name of the subform. I am getting some strange error messages.
The subroutine starts by asking for the values to be inserted and it also asks for a Type variable - this is how it determines which form is the source/destination. I had it set the variables based on this type variable and if the parameter was outside of the range it would display a message box:
vTemp = @MSGBOX("","Invalid Note Type!","");
I get the follow error message:
Error while parsing module " Global Code: Create Note":
Symbol Expected [}], symbol found [Identifier].
Line 32, position 25: [Identifier: Invalid]
vNoteNum = @MsgBox"","Invalid note Type!","");
^ (pointing at invalid)
The only way I could get it to compile was to remove the text and use the following:
vTemp = @MSGBOX("","Invalid Note Type!","");
I then got an error message on the next line using quotes:
if @Len(@FormFieldValue(vNoteDatabase,"Notes",vLoop)) < 2 then
This is the error message I got:
Error while parsing.....
Symbol Expected [}], symbol found [Identifier].
Line 52, position 48: [Identifier: Notes]
if @Len(@formFieldValue(vNotesDatabase,"Notes",vLoop)) < 2 then
^ (point it at start of vLoop)
Anyone have any ideas?