Update Text fields

Ringers

Registered User.
Local time
Tomorrow, 01:04
Joined
Mar 4, 2003
Messages
54
I have finally managed to get my combo boxes working correctly. They cascade correctly and show the right information. But now my text fields and sub form don't update from their selections.

cboBranch_Name
cboBranch_City

txtBranch_Contact
txtBranch_Phone
txtBranch_Address

Their is also a subform that needs to be linked to the selections. I really need some help with this. Any help help provided would be greatly apreacited. :)
 
Ringers,

Need more information. Are they bound forms? What is
not updating. Are the combos bound to anything?

You can delete your duplicate post in this forum.

Wayne
 
The combo boxes are unbound. The text fields are displaying their field attribute, e.g branch_contact
 
Ringers,

Do you want the combo boxes to update the text fields?
Only on new records? All the time?

Wayne
 
Wayne,

The combo boxes are just used to filter the relevant customer details. The text boxes display the information.

cbobranch_name =choose from 15 different branch(clients)

cbobranch_city = (filtered) choose from cities

The text fields and subform should now show the contact details,address,phone etc...

The database is currently populated, i just need the text fields to show information for that record. It was working, until the combo boxes became synchrozied.
 
Ringers,

OK, so your form is based on a query. The query has criteria
for three fields and references your combo boxes. Are you
referencing the combos like:

=Forms![YourForm]![cbo_Branch_Name] or
Like "*" & Forms![YourForm]![cbo_Branch_Name] & "*"

And are you doing a Me.Requery after the combo boxes are
updated?

Wayne
 
I have attached a screen shot, hope it helps.
 

Attachments

  • shot.jpg
    shot.jpg
    94.9 KB · Views: 141
it's based on one table, Branch.
Table Branch

PK Branch_id
FK Client_id
branch_name
branch_city
branch_contact
branch_address
branch_state
branch_post
branch_phone
 
To get the combo boxes to work i did the following in cboBranch_name.

Row Source: select distinct branch.name
from branch
order by branch.name


after update:

on error resume next

cbobranch_city.RowSource = "SELECT branch.city" & _
"FROM branch " & _
"WHERE branch.branch_name ='" & cbobranch_name.Value & " ' "
 
Ringers,

If you have got your cascading combo boxes to display what
you want and it is just your screen that is "out of synch" then
do this:

I'm assuming that you have a form and subform. Base the
form on a query that has all of the fields in the main form
with no criteria specified.

Link your subform to the main form using the Master-Child
links and let Access keep everything in synch for you.

At this point you should have a Master and child form
that display all of your records. And your combo boxes
display what you want but are detached from your
form's operation.

Now, make the default for your combo boxes "*" and change
your query so that it uses the combo boxes in the criteria
fields using the LIKE syntax in the previous post.

In the AfterUpdate event of EACH combo box, you currently
have code to set the row source of its "child" combo. Add
a Me.Requery to that and you should be OK.

Wayne
 
The subform and the text fields are linked togther and work when you use the records arrows to scroll through. But selections in the combo boxes have no effect on them.

How do i correct this?
 
Ringers,

Does the query for your form reference the combo boxes in
the format of a few posts ago?

If it does, do you have a Me.Requery in the AfterUpdate
of EACH combo?

Wayne
 
i'm not using a query. I have some VB(previously provided) in the cboBranch_Name(AfterUpdate), but that's it. I don't know how the subform and text fields work but they do.
 
Ringers,

If your form is going to reflect what is in your combo boxes,
you are either going to have a query that uses the combos
as criteria, or you will dynamically build a SQL statement
that uses the combos as criteria.

What is in the Events for your combos?

Wayne
 
Ringer,

It is about 2% too big to post here. Where do I mail it?
I put a query in for the main form, but I only did the search
for the first combo.

Wayne
 

Users who are viewing this thread

Back
Top Bottom