Run time error when adding new record

  • Thread starter Thread starter Aniko
  • Start date Start date
A

Aniko

Hi,

I have a main form with an option group corresponding to
tab controls used for sub-forms.
In the main Form Event Procedure, I have the following code
to keep the tab corresponding to the option group selected,
after moving between records:

Private Sub Form_Current()
Me.AssetTypeTabCtl = Me.AssetTyepOptionGroup - 1
Me.AllowEdits = Me.NewRecord
End Sub

When I attempt to add a new record I get a

Run-time error '-2147352567 (80020009)':
The setting you entered isn't valid for this property.
End or Debug

When clicking on Debug, VBA points to the
Me.AssetTypeTabCtl = Me.AssetTyepOptionGroup - 1
line in the form's Event Procedure.

Could you please help me to solve this problem?

Thanks in advance,
Aniko
 
Aniko said:
Hi,

I have a main form with an option group corresponding to
tab controls used for sub-forms.
In the main Form Event Procedure, I have the following code
to keep the tab corresponding to the option group selected,
after moving between records:

Private Sub Form_Current()
Me.AssetTypeTabCtl = Me.AssetTyepOptionGroup - 1
Me.AllowEdits = Me.NewRecord
End Sub

When I attempt to add a new record I get a

Run-time error '-2147352567 (80020009)':
The setting you entered isn't valid for this property.
End or Debug

When clicking on Debug, VBA points to the
Me.AssetTypeTabCtl = Me.AssetTyepOptionGroup - 1
line in the form's Event Procedure.

Could you please help me to solve this problem?

Thanks in advance,
Aniko

Assuming that "AssetTyepOptionGroup" is really the way that control's
name is spelled, I wonder what its value is for a new record. Is it
Null? Does it have a default value that is 0 or more than 1+the number
of pages on the tab control?
 
-----Original Message-----


Assuming that "AssetTyepOptionGroup" is really the way that control's
name is spelled, I wonder what its value is for a new record. Is it
Null? Does it have a default value that is 0 or more than 1+the number
of pages on the tab control?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
Hi Dirk,
I am back on board:-)

The spelling was wrong, but was wrong everywere.
How do I find out the value of the Option Group for a new
record?
Thanks,
Aniko
 
Dirk,

I got it, you gave me a very good clue.
I set the default value of the option group 1+ the number
of tabs.

Thank you so much:-)
Aniko

Ps this problem will not have a long thread, like the one
before:-(
 
Back
Top