form design problem

G

Guest

I'm fairly new to form design and having difficulty extracting data from one
table to include in another table. Table1 has field "software" and
"version". Table2 has "computer" and "date of installation" and "software"
and "version". I've created a form with Table2's fields... I've selected a
combo box to pull table1's fields and bound the [table1].software to
[table2].software. This appears to work fine. But now I want to also take
the table1.version field for the selected record in the combo box and bind it
to [table2].version. Maybe i'm making this more complicated then it should
be. I can't seem to get the version number from Table1. Can someone help,
pls.
 
C

Carl Rapson

The RowSource for the version combo box should be something like:

SELECT [version] FROM [Table 1] WHERE [software]='" & cboSoftware & "'"

Set this in the AfterUpdate event of the software combo box (which I've
assumed is named cboSoftware). This way, when the software is selected the
version combo box will automatically be loaded with valid version values.

Carl Rapson
 
G

Guest

Thanks carl this is helpful... but can you also give me an example of how the
afterupdate statement might look?

Carl Rapson said:
The RowSource for the version combo box should be something like:

SELECT [version] FROM [Table 1] WHERE [software]='" & cboSoftware & "'"

Set this in the AfterUpdate event of the software combo box (which I've
assumed is named cboSoftware). This way, when the software is selected the
version combo box will automatically be loaded with valid version values.

Carl Rapson

DianeA said:
I'm fairly new to form design and having difficulty extracting data from
one
table to include in another table. Table1 has field "software" and
"version". Table2 has "computer" and "date of installation" and
"software"
and "version". I've created a form with Table2's fields... I've selected
a
combo box to pull table1's fields and bound the [table1].software to
[table2].software. This appears to work fine. But now I want to also
take
the table1.version field for the selected record in the combo box and bind
it
to [table2].version. Maybe i'm making this more complicated then it
should
be. I can't seem to get the version number from Table1. Can someone
help,
pls.
 
C

Carl Rapson

Private Sub cboSoftware_AfterUpdate
If Not IsNull(Me.cboSoftware) Then
Me.cboVersion.RowSource = "SELECT [version] FROM [Table 1] WHERE
[software]='" & Me.cboSoftware & "'"
End If
End Sub

The RowSource line should be all on one line. Be sure to use your own
control, table and field names.

Carl Rapson

DianeA said:
Thanks carl this is helpful... but can you also give me an example of how
the
afterupdate statement might look?

Carl Rapson said:
The RowSource for the version combo box should be something like:

SELECT [version] FROM [Table 1] WHERE [software]='" & cboSoftware & "'"

Set this in the AfterUpdate event of the software combo box (which I've
assumed is named cboSoftware). This way, when the software is selected
the
version combo box will automatically be loaded with valid version values.

Carl Rapson

DianeA said:
I'm fairly new to form design and having difficulty extracting data
from
one
table to include in another table. Table1 has field "software" and
"version". Table2 has "computer" and "date of installation" and
"software"
and "version". I've created a form with Table2's fields... I've
selected
a
combo box to pull table1's fields and bound the [table1].software to
[table2].software. This appears to work fine. But now I want to also
take
the table1.version field for the selected record in the combo box and
bind
it
to [table2].version. Maybe i'm making this more complicated then it
should
be. I can't seem to get the version number from Table1. Can someone
help,
pls.
 
G

Guest

Thanks Carl... this works like a charm so far


Carl Rapson said:
Private Sub cboSoftware_AfterUpdate
If Not IsNull(Me.cboSoftware) Then
Me.cboVersion.RowSource = "SELECT [version] FROM [Table 1] WHERE
[software]='" & Me.cboSoftware & "'"
End If
End Sub

The RowSource line should be all on one line. Be sure to use your own
control, table and field names.

Carl Rapson

DianeA said:
Thanks carl this is helpful... but can you also give me an example of how
the
afterupdate statement might look?

Carl Rapson said:
The RowSource for the version combo box should be something like:

SELECT [version] FROM [Table 1] WHERE [software]='" & cboSoftware & "'"

Set this in the AfterUpdate event of the software combo box (which I've
assumed is named cboSoftware). This way, when the software is selected
the
version combo box will automatically be loaded with valid version values.

Carl Rapson

I'm fairly new to form design and having difficulty extracting data
from
one
table to include in another table. Table1 has field "software" and
"version". Table2 has "computer" and "date of installation" and
"software"
and "version". I've created a form with Table2's fields... I've
selected
a
combo box to pull table1's fields and bound the [table1].software to
[table2].software. This appears to work fine. But now I want to also
take
the table1.version field for the selected record in the combo box and
bind
it
to [table2].version. Maybe i'm making this more complicated then it
should
be. I can't seem to get the version number from Table1. Can someone
help,
pls.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top