Unbound textbox, query results

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

Guest

This is probably pretty easy, but it has been a while since I've used Access
2000.

I have an unbound textbox on my form that is pulling data from a table. I
want to bind that textbox to results from a sum query that uses a serial
number from the table that the form is currently connected to.

Tables:
EquipmentTable
RepairsTable

Query:
TotalRepairsQuery

Form:
EquipmentForm

SerialNumber is used as the key field for all tables and queries.
EquipmentForm gets data from the EquipmentTable for everything except my one
unbound textbox. I want the form to send the SerialNumber to the
TotalRepairsQuery and return the sum (the query does the summing) in the
unbound textbox.

Sorry this sounds confusing, but this is the best way I can explain it.
Thank you very much.
 
Perhaps you can use the DLookup function in an expression that is the
control source for the textbox?
 
If I understand what you want to do: In your 'TotalRepairsQuery' you need to
put in your criteria under the serial number field a statement like "Like
[forms]![EquipmentForm]![Serial Number Field?]", then save it. In your form
you need to create a Requery statement in VB in the 'AFTER UPDATE' line in
your properties. That way whenever you change the serial number in your
unbound textbox it will requery your table.
 
I want my unbound textbox to display the results from a query. Serial
number will be changed going from one record to the next, and yeah, when the
other textboxes are displaying another record, the query will need to pull
the new number and put it in the unbound textbox.

Thank you both for your help. I think I have been making some progress with
the DLookup function, but I still don't have it working 100%.

Orrin

SDITMan said:
If I understand what you want to do: In your 'TotalRepairsQuery' you need to
put in your criteria under the serial number field a statement like "Like
[forms]![EquipmentForm]![Serial Number Field?]", then save it. In your form
you need to create a Requery statement in VB in the 'AFTER UPDATE' line in
your properties. That way whenever you change the serial number in your
unbound textbox it will requery your table.

orrin said:
This is probably pretty easy, but it has been a while since I've used Access
2000.

I have an unbound textbox on my form that is pulling data from a table. I
want to bind that textbox to results from a sum query that uses a serial
number from the table that the form is currently connected to.

Tables:
EquipmentTable
RepairsTable

Query:
TotalRepairsQuery

Form:
EquipmentForm

SerialNumber is used as the key field for all tables and queries.
EquipmentForm gets data from the EquipmentTable for everything except my one
unbound textbox. I want the form to send the SerialNumber to the
TotalRepairsQuery and return the sum (the query does the summing) in the
unbound textbox.

Sorry this sounds confusing, but this is the best way I can explain it.
Thank you very much.
 
Back
Top