Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 976625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:46:36+00:00 2026-05-16T03:46:36+00:00

I have a tab control on a form, and a couple different tabs have

  • 0

I have a tab control on a form, and a couple different tabs have save buttons on them. Once the user saves data (via SQL statements in VBA), I set the .enabled = false so that they cannot use this button again until moving to a brand new record (which is a button click on the overall form).

so when my form open i was going to reference a sub that enabled all these save buttons because the open event would mean new record. though i get an error that says it either does not exist, or is closed.

any ideas?

thanks

EDIT:

Sub Example()
error handling

Dim db as dao.database
dim rs as dao.recordset
dim sql as string

SQL = "INSERT INTO tblMain (Name, Address, CITY) VALUES ("

if not isnull (me.name) then
    sql = sql & """" & me.name & ""","
else
    sql = sql & " NULL,"
end if

if not insull(me.adress) then
    sql = sql & " """ & me.address & ""","
else
    sql = sql & " NULL,"
end if

if not isnull(me.city) then
   sql = sql & " """ & me.city & ""","
else
   sql = sql & " NULL,"
end if

'debug.print(sql)
set db = currentdb
db.execute (sql)

MsgBox "Changes were successfully saved"

me.MyTabCtl.Pages.Item("SecondPage").setfocus
me.cmdSaveInfo.enabled = false

and then on then the cmdSave needs to get re enabled on a new record (which by the way, this form is unbound), so it all happens when the form is re-opened. I tried this:

Sub Form_Open()

me.cmdSaveInfo.enabled = true

End Sub

and this is where I get the error stated above. So this is also not the tab that has focus when the form opens. Is that why I get this error? I cannot enable or disable a control when the tab is not showing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:46:36+00:00Added an answer on May 16, 2026 at 3:46 am

    You cannot use the form open event to manipulate controls, they have not been initiated at that stage. Use the form load event.

    It should never be necessary to set focus to a tab, or even to reference it when working with a control. You will notice that controls must have names unique to the form, and adding a tab does not change this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a tab control and few forms. Each form opens in a
So I have a form with lots of controls that all have a tab
I have a Tab Control with multiple Tab Pages. I want to be able
I have a tab navigator control and I would like to make all of
I have a page with a tab control and each control has almost 15
I have 2 tab items. In tab No.1 I have a control which corresponds
I have a tabpanel with a calendar control on the 4th tab but when
I have thought of this idea where you could have a tab control on
Basically, I am creating a Windows Form with a Tab Control on it, and
I have a login.jsp page which contains a login form. Once logged in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.