473,385 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SubForm to Form Tab VBA

I have a subform and a form. Both are in their own tabs. I would like to disable the tab with the main form when someone clicks a specific textbox on the subform.
Dec 10 '07 #1
4 1897
missinglinq
3,532 Expert 2GB
I have a subform and a form. Both are in their own tabs.
You cannot have a form on a tab! A form on a tab is a subform, so you have two subforms on two tabs!

I would like to disable the tab with the main form when someone clicks a specific textbox on the subform.
You need to tell us a little more about what you're trying to do. If the textbox is clicked on, do you want the other tab disabled permanently or temporarily? If temporarily, when do you want the tab re-enabled?

Linq ;0)>
Dec 10 '07 #2
I have a table CASES. There are hundreds of records. I want to create a form that has two tabs. On the first tab I want a datasheet that displays all the data in the table and the second tab that displays a form with the same records based on the same table. On form load the second tab is disabled. Once a user double clicks on the case_id field in the data sheet, I want the second tab which contains the form for the same table to be enabled and display the record selected on the datasheet based on the case_id. I just don’t know the code when working with subforms. Thanks a million guys.
Dec 10 '07 #3
NeoPa
32,556 Expert Mod 16PB
I don't know the answer to this one, but until Linq gets back you may want to check out Referring to Items on a Sub-Form. It may prove useful.
Dec 12 '07 #4
jaxjagfan
254 Expert 100+
Sounds like you want to display all the records on one tab and use tab1 to navigate tab2. You could easily do this using a Combobox on your form (vice tabs). The combobox could display 1 or more fields in a droplist. Make sure your "ID" is in the bound column (defaults to column 1). Code would look similar to this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cboMyCombo_AfterUpdate()
  2. DoCmd.GoToControl "txtRecordID" 'The control with the ID in it
  3. DoCmd.FindRecord Me.cboMyCombo, , False, , False, , True
  4. End Sub
  5.  
You can use pretty much the same code for what you are trying to do.
But gets a little tougher. In a module declare your variable: Public varID as Variant. That way its not form specific.
Expand|Select|Wrap|Line Numbers
  1. Private SubMySubForm_DblClick(Cancel As Integer)
  2. varID = Me.txtID 'Name of control on subform with ID field assigned to it   
  3. DoCmd.GoToControl "txtRecordID" 'The control with the ID in it - the single records
  4. DoCmd.FindRecord varID, , False, , False, , True
  5. End Sub
  6.  
I have used a list similar to you on a project - when user double-clicked on a record it opened the selected record in its own form as a dialog box. When user finished edit and closed dialog they could navigate to next record or quit app.
Dec 12 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
12
by: MLH | last post by:
I have created two forms: frmBrowseNegsMainform and frmBrowseNegsSubform. I put a subform control on the first of these. The SourceObject property for the subform control is, of course,...
1
by: John Michael | last post by:
I have a form that has a subform that has a subform. The subform loads a record based on a combo lookup box in the main form. I'm trying to set a value in the subform based on a value in a...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
6
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
7
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm...
11
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.