Question : Problems with parsing an error message into a label on a form

Hi experts,

I am having trouble with parsing an error message through to a label (lblTitle) on a form I am opening (SystemErrorMessage).  I thought I had this working but now see that I do not.

The code is:

DoCmd.OpenForm "SystemErrorMessage", , , "lblTitle=" & Err.Number & ": " & Err.Description

Can anybody help me to understand how to parse this information through to lblTitle?

Any help is always appreciated.  

Regards

Terry

Answer : Problems with parsing an error message into a label on a form

You have used the Where condition in your command.

What that does is force Access to FIND a record that satisfies the where clause.  It does not Create one.

If you want to pass data to a form then you can use the Openargs parameter :

DoCmd.OpenForm "SystemErrorMessage", , , ,,, Err.Number & ": " & Err.Description

Then in your SystemErrorMessage form you can assign the value.

If SystemErrorMessage is an unbound form then you can use the form load event procedure:
me.lblTitle=me.openargs




Random Solutions  
 
programming4us programming4us