On Click Function... (1 Viewer)

Villarreal68

Registered User.
Local time
Today, 00:44
Joined
Feb 15, 2007
Messages
133
Hello everyone,

I have a dilema and I hope someone can help me...

I have a simple event on the On Click of a sub-form in datasheet view. When someone single clicks the sub-form I have the following code:

Forms!frmTransactionEntry![txtTranID]=Forms!frmTransactionEntry!TransactionsByDepartment![TranID]

This code is sort of a pre-setup for a "Double-Click" which opens an Edit Window that brings transaction record ID that equals "Forms!frmTranwsactionEntry![txtTranID]"

It works great when the form has entries, but when the form is empty I get Run-time error 2113 " The value you entered isn't valid for this field."

How can I have it ignore this On Click if the form is empty? :banghead:

thank you in advance for your time.
 

Villarreal68

Registered User.
Local time
Today, 00:44
Joined
Feb 15, 2007
Messages
133
Well I think I just fixed it in a different way than I was visualizing:

I was visualizing some code in the On Click code to ignore when the sub-form was empty, but I just changed the code on the Double Click to go straight to the sub-form ID field.

I hope this doesn't bite me later. :)

Thanks all that had read and were diligently working on a solution for this knuckle head. :)
 

vbaInet

AWF VIP
Local time
Today, 08:44
Joined
Jan 22, 2010
Messages
26,374
There are several ways around what you're doing and it sounds like you've just band aid fixed it. You could have either not passed a value to the edit form if there's no record or not open it all.

I'm not sure why you're needing to pass a value from the subform to the parent form either.
 

Users who are viewing this thread

Top Bottom