set table value from subform listbox that queries info

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to get the data that my subform queries into a listbox to go to
the table after the results come back or when the record is saved via a
select button. How can I do this?
 
Hi,


If the data is presented in the subform, it is already in a table, isn't
it? So, basically, it is a matter to apply a filter? Using a standard query
should be a doable solution, to select the data, or an Append query, or make
table query, to append the filtered data to a table. You have to determine
the appropriate WHERE (criteria) clause to apply to the original data.



Hoping it may help,
Vanderghast, Access MVP
 
For your first question, unfortunately no. In the subform I have a box that
you select a part number from an outside database. This does go to the
table. Based on this selection the other 2 boxes pull information from the
outside database as a list box (which is only 1 record) from another query.
This is what is not recording to the table.

In addition to this issue when I go to a new record, in either the form or
the subform, the latest queried information for the 2 boxes stays the same on
all subform records. Again none of these make it to the table.

Is there a way to force it to press enter so the record goes into the table?
If I manually do this it works but the operator should not have any need to
do this.

It gets frustrating because nothings shows up on the table and part number
descriptions do not match when I move to a new record.


Michel Walsh said:
Hi,


If the data is presented in the subform, it is already in a table, isn't
it? So, basically, it is a matter to apply a filter? Using a standard query
should be a doable solution, to select the data, or an Append query, or make
table query, to append the filtered data to a table. You have to determine
the appropriate WHERE (criteria) clause to apply to the original data.



Hoping it may help,
Vanderghast, Access MVP
 
Hi,


I don't follow. If a subform has to display multiple records, those have
to come from a, or many, tables. If you only push data into controls through
VBA code, you can only supply the "actual" record, which is just ONE record,
not many. If you have just one record, you can add it to a table with:

DoCmd.RunSQL "INSERT INTO myTable(listOfFields)
VALUES(FORMS!FormName!ControlName1, ..., FORMS!FormName!ControlNameN) "



If you have multiple records to append, from fixed values, you can issue M
such times that statement.


Generally, a form, or a subform, is "bound" either to a table, either to
a query (more than one table), either not bound at all, but in the last
case, you have just one "record". You loose me when you say your sub-form is
not bound, and that you expect many records.





Vanderghast, Access MVP


James Kendall said:
For your first question, unfortunately no. In the subform I have a box
that
you select a part number from an outside database. This does go to the
table. Based on this selection the other 2 boxes pull information from
the
outside database as a list box (which is only 1 record) from another
query.
This is what is not recording to the table.

In addition to this issue when I go to a new record, in either the form or
the subform, the latest queried information for the 2 boxes stays the same
on
all subform records. Again none of these make it to the table.

Is there a way to force it to press enter so the record goes into the
table?
If I manually do this it works but the operator should not have any need
to
do this.

It gets frustrating because nothings shows up on the table and part number
descriptions do not match when I move to a new record.
 
Back
Top