Form refresh

  • Thread starter Thread starter mbr96 via AccessMonster.com
  • Start date Start date
M

mbr96 via AccessMonster.com

I have a combo box on a form which will be used to select an equipment
category code. That code will determine an equipment useful life (years), a
lease term (years) and lease rate factor (decimal) by pulling those values
from related tables. The recordsource of the form is a query that contains
all the tables.

After a user picks the category code, I want the three related values to
automatically populate. I used a Me.Refresh on the AfterUpdate property of
the category code control, nothing happens. I tried Me.Requery, and that
populates the data but puts the form back on the first record, not on the
record that I just entered the category code.

How can I make the three related fields autopopulate but stay on the same
record on the form? Maybe some code on an event for the form instead of the
category code control??

Thanks in advance - this site is very helpful!!

MBR
 
Have you tried using dlookup for the related fields?

=dlookup("field value to grab","the table name","the condition")
 
Thanks, yes, I'm aware that's another method to pull the values. I'm trying
to populate the values to bound fields, though, so I'd have to have another
command to set the value of the bound control to the value of the dlookup. I
was hoping to just refresh / requery the data and stay on the same record.

I also researched a way to do it with multiple values in a combo box, with
other fields referencing the column property of the combo box. Same problem
there, I need to put the values in bound controls to populate a data template.


I may try these other methods if I can't figure out a way to just refresh the
data and stay on the same record.

Thanks again.

MBR



Chris said:
Have you tried using dlookup for the related fields?

=dlookup("field value to grab","the table name","the condition")
I have a combo box on a form which will be used to select an equipment
category code. That code will determine an equipment useful life (years), a
[quoted text clipped - 15 lines]
 

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

Back
Top