In the end I used another technique by disabling the combo boxes (setfocus.enabl e = False), except for the first, until a selection had been made in the first.......... .............
I included a command button I called "Reset Selections" to give the user the ability to reset previous selections if they wanted to make other choices.
Keith.
User Profile
Collapse
-
So would I need the same coding in both the AfterUpdate and in the OnChange Event or eliminate the AfterUpdate coding and just simply move it to a OnChange event?
Thanks for the idea.
Keith....Leave a comment:
-
Cascading Combo Box - Another angle on the subject.....
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box:
[code=vb]
Private Sub CboDivision_Aft erUpdate()
'When the Division is selected, the appropriate Segment list will
'display in the drop down list of CboSegment
With Me![cboSegment]
If IsNull(Me!cboDi vision) Then
.RowSource = ""
Else
... -
-
Hello:
Basically, what I am trying to do is make sure that the selections that they have selected is one of my Unique "LocationID s" in my tblLocationsMM. Right now they are able to move forward to the next form even though the LocationID does not exists.
What would be the best approach for preventing this scenario?
Thanks,
Keith.Leave a comment:
-
Cascading Combo Box - Rest-
Hello:
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box:
[code=vb]
Private Sub CboDivision_Aft erUpdate()
'When the Division is selected, the appropriate Segment list will
'display in the drop down list of CboSegment
With Me![cboSegment]
If IsNull(Me!cboDi vision) Then
.RowSource = ""
... -
I solved this one, no need to reply.....
I had another cascading code where the definition event procedure was the issue:
Private Sub cboSegment_Afte rUpdate(Cancel As Integer)
Changed to:
Private Sub cboSegment_Afte rUpdate()
That is what happens when you copy your old code to something new.......
Thanks,
Keith.Leave a comment:
-
Problem with Cascading Combo/List Boxes
Good Morning:
I have a form where I am trying to create cascading combo boxes. I have done this before but I am getting the following error that is throwing me off:
[code=text] Procedure declaration does not match description of event or procedure having the same name. [/code]
Basically have three tables:
One for the Division location:
tblDivision
DivisionID = Autonumber... -
Okay:
I was playing around with this and stuck with my above query idea. I changed the control name from [NWP_Calc2] to [NWP_Calc] and added the following code to my control [Sum50NWP]:
[code=vb] =Sum(IIf([Binding_Percent age]=50,Nz([NWP_Calc],0),0)) [/code]
Checked my other vb on this form, performed a "Compact and Repair Database...." and bang it worked!
Thanks for the ideas....Leave a comment:
-
I have also taken another route with the same result ("#Error"). My form is based on a query, so I added a calculated field in the query [NWP_Calc2] and then when back to the form, went to "field list" and dropped the control into the form. The new control calculates correctly. Then I modified my [Sum50NWP] with the following formula in the control source:
[code=vb] =Sum(IIf([Binding_Percent age]=50,[NWP_Calc2],0))...Leave a comment:
-
Hello:
I checked the properties on [NWP_Calc] and it is set to Standard. This is in sync with my [GWP] & [Cede] controls so that should not be it.
I also tried the new syntax but get the same result. Your third idea may make more sense because I indicated that my other unbound text box [Sum50GWP] is impacted as well where I would have thought otherwise since the control source it is not dependent on [NWP_Calc]....Leave a comment:
-
Hello Me again:
A further note, that I don’t fully understand, is that my other unbound text box [Sum50GWP] with the following formula in the control source:
[code=vb] =Sum(IIf([Binding_Percent age]=50,[GWP],0)) [/code]
Is also getting this same error message “#Error”. Is the fact that since now I am basing my control source of [Sum50GWP] on another calculated unbound control [NWP_Calc] the root of...Leave a comment:
-
Also take a look at this Building Union Queries. All the columns have to match in name and type to work correctly.....
It sounds like you want to merge data all into one row. If so, can you not start from scratch, by pulling both tables into a new query and then pulling in the fields that you are looking to populate?
Keith....Leave a comment:
-
"#Error" in an Unbound Text box - Continuous form
Hello:
I three fields on a continuous form:
[GWP], [NWP] & [Binding_Percent age]
On the same form I have an unbound text box [Sum50NWP] with the following formula in the control source:
[code=vb] =Sum(IIf([Binding_Percent age]=50,[NWP],0)) [/code]
This worked great.
Now I am being requested that my user does not want an End User to input a number into the [NWP]... -
So I can understand, give me the result (the one row only..) that you thought the Union Qry would display using the above example........
Keith....Leave a comment:
-
Can you post the SQL of the "Dog" query and the SQL of the "Cat" query. It would make it easier to understand.
Best regards,
Keith.Leave a comment:
-
The reason why it was happening makes complete sense to me now. In fact, Yesterday I said to myself that that somehow the DB did believe that there was a value being slected in [ProductIDFK]; it was the only thing that made sense to why it was happening.
Both solutions solved the problem.
Thanks a lot!!!
Keith....Leave a comment:
-
ADezii:
Apology accepted and so the saying goes “Things happen” well, you know what I mean…..
Now back to the issue at hand. My problem is still gnawing at me. I believe it is in the before update event on my Form called “Forecast”. The problem only happens when a new record is created. That is to say if I was to blank out the [ProductIDFK] field on an existing record being displayed the msgbox in my code...Leave a comment:
-
-
I sent ADezii an e-mail to remove. I don't mind the code but I do mind the DB since I am the creator and I sent it to him privately. Hopefully this can be resolved sooner than later.
Keith....Leave a comment:
No activity results to display
Show More
Leave a comment: