Requery Subform - Not Same Record (1 Viewer)

M

mozmac

Guest
Hi. First off I want to say that these forums are a gold mine. You all do a great job. Keep it up!

I work at a University and keep a database of students. On the main form for the student, you select their name from a combo box and the whole form refreshes to show the data for your selection. There are four subforms that keep track of things like a questionnaire, career center visits, etc. The problem I am having is with the Career Center visits.

There is a button that allows you to make an entry into a log when they come into the career center. Clicking on it opens up a small window where you can put notes and with whom they spoke while they were here. Upon closing the window, it adds the entry to the log for that particular student. That all works great. Each student has their own log...all is good.

However, upon closing the window, the main form jumps back to the first student in the list. The entry is added to the correct student, but you must find the student from the combo box in order to see it. It is just annoying to have to do it and I would like to fix it. Can't figure out why it is doing it, though.

Any ideas? I would like it to add the entry to the student, and stay on their record.
 

RuralGuy

AWF VIP
Local time
Today, 07:03
Joined
Jul 2, 2005
Messages
13,826
It sounds like there is code that is doing a Requery, either under the LogEntry cmdButton or maybe the other form. It does not sound like a Requery is necessary, but I can not be sure without additional information or maybe a sample of the db.
 

Aquadevel

Registered User.
Local time
Today, 08:03
Joined
Sep 23, 2005
Messages
16
Requery....

Now that Hurricane Rita has left her 'mark', I need some insight into a 'requery' issue with a subform also. I have a form AddFieldTicket that has a subform 'FieldTicketItems' which has a combo box on it to allow user to select items available. works fine, sends items to FieldOrders perfectly. Also, a update query flags the items selected and that works perfect also.

Issue is, if user does not close & re-open the 'AddFieldTicket' main form the combobox does not get 'requery'd' as to what now available from item list.
So every item in inventory shows up in the combobox. I've tried every suggestion I received today, with nothing working.

It has to be something I've overlooked.

Thanks for any suggestions! :)
 

RuralGuy

AWF VIP
Local time
Today, 07:03
Joined
Jul 2, 2005
Messages
13,826
Aquadevel,
When a ComboBox is based on dynamic information you need to requery the ComboBox in an event like GotFocus so that the data is updated every time you select the ComboBox.
It would have been better to start another thread so that everyone would see your question and have a chance to respond. This way it is tagging on mozmac's question, which is not quite the same as yours.
 

Aquadevel

Registered User.
Local time
Today, 08:03
Joined
Sep 23, 2005
Messages
16
Rural,

Yah I agree, I should have made new post.... :eek:
I tried 'every-which-way-but-loose' to get the issue resolved.

<I'll keep trying> :p
 

RuralGuy

AWF VIP
Local time
Today, 07:03
Joined
Jul 2, 2005
Messages
13,826
Did you post elsewhere and I missed it? I monitor several forums and news groups. Did you try the Me.ComboBoxName.requery in the GotFocus event?
 

Users who are viewing this thread

Top Bottom