How to get a text box to update from a subform question

D

Dan_S

Dear all,

I'm having problems with a text box that I have used to pass data from a
subform to another form.

Initially this worked well, although for some reason now, when I select a
record in the subform, the text box that is meant to be updated on the main
form will only update when I'm on a new or blank record.

This kind of defeats the object, as I'm trying to pass data to existing
records that eventually makes it into another subform/table.

My control source for the text box is: =CourseListSubform.Form!txtCourseID

If I put in the square brackets that everywhere seems to suggest, Access
takes them out.

Do I need to run a macro to update the main form once I've selected the
desired record in the subform, or is there another way of updating this box?

I don't really want to go into VB as this system needs to be fairly simple
for other users/administrators.

Thanks,

Dan
 
D

Douglas J. Steele

I suspect you need to do a requery on the text box. You might be best off
putting code in the AfterUpdate event of the text box on the subform.
 
D

Dan_S

Thanks Doug. I did a requery on the text box in the main form, and put it in
the After Update box like you've said.

It now works, but requires the user to double click on the record in the
first subform, but that's fine. Single clicking seems to have some sort of
action that refreshes the subform itself, taking the record selection back to
the first record.

The interesting thing is that this doesn't appear to work on its own. I have
to have the same macro running in the 'On Click' event on the subform in
order for it to actually update the box.

At least it works now, so thanks for your help.

Kind Regards,

Dan
 

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