Run time error when adding new record

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
 
D

Dirk Goldgar

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?
 
G

Guest

-----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
 
G

Guest

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:-(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top