help,help,help,help,help,help,help,help,help,help,help,help,help,

help,help,help,help,help,help,help,help,help,help,help,help,help,

Post by Enrique G Lug » Tue, 06 Jan 1998 04:00:00



Hi,
I have a small problem, and if you know the answer I would really be
thankful for your help.
I have an access database which is called "Client.mdb"
on a form, I displayed a dbcombox for the costumer's name
a textbox for the address
a textbox for the city
a textbox for the state
and a textbox for the zipcode

on all my textboxes and the dbcombobox I have set their Datasource and
Datafield properties to Data1,
when I run the program the information on the first record of the data shows
on the form,

but what I need to do is, when I change the costumer's name on the
dbcombobox (which displays all of the costumer's names on it) I want the
textboxes to show the address, city, state, and zipcode of the costumer I
have choosen,

Thank you in advance,
Enrique G Lugo

 
 
 

help,help,help,help,help,help,help,help,help,help,help,help,help,

Post by Chris Chu » Tue, 06 Jan 1998 04:00:00



Quote:>I have an access database which is called "Client.mdb"
>on a form, I displayed a dbcombox for the costumer's name
>a textbox for the address
>a textbox for the city
>a textbox for the state
>and a textbox for the zipcode

>on all my textboxes and the dbcombobox I have set their Datasource and
>Datafield properties to Data1,
>when I run the program the information on the first record of the data shows
>on the form,

>but what I need to do is, when I change the costumer's name on the
>dbcombobox (which displays all of the costumer's names on it) I want the
>textboxes to show the address, city, state, and zipcode of the costumer I
>have choosen,

You are not using the controls the way that they should be used.
Natively, the controls cannot do what you want without some coding.

Use two data controls, one bound to the dropdown control and
one bound to the rest of the text boxes, called dbCombo and dbText.

In the .Change() event of the dropdown box, do a
dbText.Recordset.FindFirst "Name = '" & Combo.text & "'"

HTH


- Code Gurus: Custom solutions programmed for your business.
- Fair rates, fast response, rock-solid code. Initial consultation free.
- Visual Basic, Tiered databases, Java, Perl, Internet programming.

 
 
 

help,help,help,help,help,help,help,help,help,help,help,help,help,

Post by Lee J. Wein » Tue, 06 Jan 1998 04:00:00


After a selection is made in the dbcombobox, the line:
        Data1.RecordSet.FindFirst "customername = '" & dbCombo.Text & "' "
where customername is the name of the data base field.  This should move the
data control pointer to the record with that name and automatically populate
the bound text boxes from that record.

Lee Weiner
weiner AT fuse DOT net



>Hi,
>I have a small problem, and if you know the answer I would really be
>thankful for your help.
>I have an access database which is called "Client.mdb"
>on a form, I displayed a dbcombox for the costumer's name
>a textbox for the address
>a textbox for the city
>a textbox for the state
>and a textbox for the zipcode

>on all my textboxes and the dbcombobox I have set their Datasource and
>Datafield properties to Data1,
>when I run the program the information on the first record of the data shows
>on the form,

>but what I need to do is, when I change the costumer's name on the
>dbcombobox (which displays all of the costumer's names on it) I want the
>textboxes to show the address, city, state, and zipcode of the costumer I
>have choosen,

>Thank you in advance,
>Enrique G Lugo


 
 
 

help,help,help,help,help,help,help,help,help,help,help,help,help,

Post by dpwrigh » Tue, 06 Jan 1998 04:00:00


1st...Make sure that all textboxes are databound to data1.
2nd..Make sure that data1 is a snapshot unless you are ready to edit your
info.
3rd...Put this snippet in your code.

        Private Sub DBCombo2_Click(Area As Integer)
                Select Case Area
                    Case 2
                        Technician.Recordset.Bookmark = DBCombo2.SelectedItem
                End Select
        End Sub

Now when an item is selected from the dbcombo all the other fields will be
updated to.
Perry



> Hi,
> I have a small problem, and if you know the answer I would really be
> thankful for your help.
> I have an access database which is called "Client.mdb"
> on a form, I displayed a dbcombox for the costumer's name
> a textbox for the address
> a textbox for the city
> a textbox for the state
> and a textbox for the zipcode

> on all my textboxes and the dbcombobox I have set their Datasource and
> Datafield properties to Data1,
> when I run the program the information on the first record of the data
shows
> on the form,

> but what I need to do is, when I change the costumer's name on the
> dbcombobox (which displays all of the costumer's names on it) I want the
> textboxes to show the address, city, state, and zipcode of the costumer I
> have choosen,

> Thank you in advance,
> Enrique G Lugo


 
 
 

help,help,help,help,help,help,help,help,help,help,help,help,help,

Post by Alex Galki » Thu, 08 Jan 1998 04:00:00



>Hi,
>I have a small problem, and if you know the answer I would really be
>thankful for your help.
>I have an access database which is called "Client.mdb"
>on a form, I displayed a dbcombox for the costumer's name
>a textbox for the address
>a textbox for the city
>a textbox for the state
>and a textbox for the zipcode

>on all my textboxes and the dbcombobox I have set their Datasource and
>Datafield properties to Data1,
>when I run the program the information on the first record of the data
shows
>on the form,

>but what I need to do is, when I change the costumer's name on the
>dbcombobox (which displays all of the costumer's names on it) I want the
>textboxes to show the address, city, state, and zipcode of the costumer I
>have choosen,

>Thank you in advance,
>Enrique G Lugo


Try this approach:
1. In your combobox you must add all fields of interest in SQL SELECT
DISTINCTROW statement (See Combobox Linesource property): Name (must be
first), address, city etc.
2. Write the following procedure on the combobox after update event:

Private Sub ComboBoxName_AfterUpdate()
        Me.Address = Me.ComboBoxName.Column(1)
        Me.City = Me.ComboBoxName.Column(2)
        etc...
End Sub

Here on the left side are the names of textboxes in your form. Leave their
Data Source properties empty.

Good luck!

Alex Galkin


 
 
 

1. Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,

Hi,
I have a small problem, and if you know the answer I would really be
thankful for your help.
I have an access database which is called "Client.mdb"
on a form, I displayed a dbcombox for the costumer's name
a textbox for the address
a textbox for the city
a textbox for the state
and a textbox for the zipcode
on all my textboxes and the dbcombobox I have set their Datasource and
Datafield properties to Data1,
when I run the program the information on the first record of the data shows
on the form,
but what I need to do is, when I change the costumer's name on the
dbcombobox (which displays all of the costumer's names on it) I want the
textboxes to show the address, city, state, and zipcode of the costumer I
have choosen,
Thank you in advance,
Enrique G Lugo

2. Problem in GeoMedia(Intergraph)

3. help help help help help help help help help

4. Million Records in SQL

5. SQL To ORACLE Help Help Help Help Help

6. TGraphicField.LoadFromFile Question

7. query:HELP! HELP HELP HELP HELP

8. Convert varbinary(16) to varchar(32)

9. HELP HELP HELP HELP!

10. HELP HELP HELP HELP

11. Help help help help

12. HELP HELP HELP