473,387 Members | 1,891 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,387 software developers and data experts.

autoupdate with a subform

I am having some issues on a VERY BASIC task.

I have a form with a subform that contains 3 combo boxes. What I need is to have the 3rd combo box change based on the selection of the 1st combo box. as of now i have this code... any help would be great!

Private Sub cmbPhase_ID_AfterUpdate()

If [frmPhaseInfo subform1]!cmbPhase_ID = 3 Or [frmPhaseInfo subform1]!cmbPhase_ID = 5 Or [frmPhaseInfo subform1]!cmbPhase_ID = 8 Then


[frmPhaseInfo subform1]!cmbPhaseResourceID = 605


End If


End Sub

Does that look right?

TIA,
Mike -- a first time poster!
Jan 14 '08 #1
3 2564
mshmyob
904 Expert 512MB
if it doesn't then try referencing all the way from the main form like so

forms!frmMain!subform.cmbPhase_ID=3 etc.

I am having some issues on a VERY BASIC task.

I have a form with a subform that contains 3 combo boxes. What I need is to have the 3rd combo box change based on the selection of the 1st combo box. as of now i have this code... any help would be great!

Private Sub cmbPhase_ID_AfterUpdate()

If [frmPhaseInfo subform1]!cmbPhase_ID = 3 Or [frmPhaseInfo subform1]!cmbPhase_ID = 5 Or [frmPhaseInfo subform1]!cmbPhase_ID = 8 Then


[frmPhaseInfo subform1]!cmbPhaseResourceID = 605


End If


End Sub

Does that look right?

TIA,
Mike -- a first time poster!
Jan 15 '08 #2
can you be more specifc on how to write that code... sorry couldnt really get that to work! the main form is frmSRF and the sub form is frmPhaseInfo subform1... so i have this...

Forms!frmSRF![frmPhaseInfo subform1].cmbPhaseResourceID = 605

doesnt work.

thanks for the prompt reply!
mike
Jan 15 '08 #3
mshmyob
904 Expert 512MB
First of all is to check if your IF statement is being triggered? An easy way to check is to put the following after your IF statement

lr=msgbox("Triggered")

If the IF statement is working a message box should pop up saying Triggered. If that is OK the tell me what is not working? Such as...

Is no value going into cmbPhaseResourceID or are you getting an error message.

can you be more specifc on how to write that code... sorry couldnt really get that to work! the main form is frmSRF and the sub form is frmPhaseInfo subform1... so i have this...

Forms!frmSRF![frmPhaseInfo subform1].cmbPhaseResourceID = 605

doesnt work.

thanks for the prompt reply!
mike
Jan 15 '08 #4

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

Similar topics

0
by: noam_a_jacobs | last post by:
Hi, I have a technical question for those smart cookies with update management experience. We use a product called EasyUpdate, from www.AutoUpdatePlus.com, to manage the updates of our app after...
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...
0
by: Cute^_^ | last post by:
Hi all, Just recently started to learn how to use Access2002 and discovered the power of programming a database. Lately, I want to create a database for my own use. There are some quires I would...
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...
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...
1
by: MP | last post by:
I have a main form that has a subform which also has a subform: the main form is the first subform is the second subform is When I click on the button »AddNewSubSubRecord« (add a new record...
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...
1
by: tasmontique | last post by:
I am using access 2000. I have two questions Question 1 I have 3 tables. tblFlight, tblAircraftType, tblFlightProgramIN/OUT. tblFlight has a 1 to many relationship with tblAircraftType,...
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: 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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.