Name added to input form not appearing in my drop down

G

Guest

Hi,

I have an access application that keeps track of people who sign up for
classes at a gym. There is a main form called BuildRoster that has drop down
boxes for things like instructor name and date and a subform called
AddToRoster that is continuous and has a drop down box for people who come in
for the classes. It is based on a query called CustomerQuery which is based
on a customer table. In addition, on the main form there is a button that
opens a form called AddCustomers that allows me to add names to the table.
So if a customer does not appear in my drop down list in the AddToRoster
form, I go to the AddCustomers form that allows me to add them. After I
close the AddCustomers form I am back at my main BuildRoster form and I click
on the drop down in the subform to select the name that I just entered.
However, they are not there. I have to actually close the entire BuildRoster
form and then reopen it. When I reopen it and click on the drop down in the
subform, the customer is there. Is there a way to get the customer to appear
in this drop down without having to close the form and go back in?

Thanks,
 
G

Guest

Chuck,

All you need is to requery the combo box. You can either do this as part of
the close AddCustomers form routine, or better, in the main form's OnActivate
event.

Me![YourSubform].Form![YourComboBox].Requery

Hope that helps.
Sprinks
 
G

Guest

Hi,
Thanks for your help. Your suggestion worked. I have one other question
for you. On my subform I can select people to sign up for a particular class.
While inputting people I accidentally adding some people to the wrong class.
I went in and deleted them and then readded them to the right class. I
noticed in my table that there are records for these people from the class
that I deleted. Whenever someone signs up for a class the data gets added to
a table called AddClientToRoster which has a RosterID and a CustomerID
field. The CustomerID field is blank for the ones I deleted but there are
still three records. Is there a way to delete all records from a table in
which the CustomerID field is blank?

Thanks,

Chuck
--
Chuck W


Sprinks said:
Chuck,

All you need is to requery the combo box. You can either do this as part of
the close AddCustomers form routine, or better, in the main form's OnActivate
event.

Me![YourSubform].Form![YourComboBox].Requery

Hope that helps.
Sprinks

ChuckW said:
Hi,

I have an access application that keeps track of people who sign up for
classes at a gym. There is a main form called BuildRoster that has drop down
boxes for things like instructor name and date and a subform called
AddToRoster that is continuous and has a drop down box for people who come in
for the classes. It is based on a query called CustomerQuery which is based
on a customer table. In addition, on the main form there is a button that
opens a form called AddCustomers that allows me to add names to the table.
So if a customer does not appear in my drop down list in the AddToRoster
form, I go to the AddCustomers form that allows me to add them. After I
close the AddCustomers form I am back at my main BuildRoster form and I click
on the drop down in the subform to select the name that I just entered.
However, they are not there. I have to actually close the entire BuildRoster
form and then reopen it. When I reopen it and click on the drop down in the
subform, the customer is there. Is there a way to get the customer to appear
in this drop down without having to close the form and go back in?

Thanks,
 
G

Guest

Chuck,

How did you "delete" them? Did you simply make the Customer field blank?
This won't delete the record. Also, it would seem that this field should be
Required such that merely blanking the field would issue a warning message.

To delete the record itself, click and drag on the Record Selector at the
left edge of the subform to select the records to be deleted, then press the
Delete key. You will be prompted to confirm the deletion.

If your subform does not have a Record Selector, change the RecordSelectors
property on the Format tab in form design view to Yes.

Another interesting way to look at your data is a main form based on
Customers with a subform based on Classes. To change the mistakenly entered
class, you could press a button on the first form to open the 2nd for the
customer currently selected, then change the class. On returning to the
original form, you should requery the subform to update the information. A
convenient place to do this is in the OnActivate event:

Me![YourSubform].Requery

The customer should no longer appear in the list.

Hope that helps.
Sprinks


ChuckW said:
Hi,
Thanks for your help. Your suggestion worked. I have one other question
for you. On my subform I can select people to sign up for a particular class.
While inputting people I accidentally adding some people to the wrong class.
I went in and deleted them and then readded them to the right class. I
noticed in my table that there are records for these people from the class
that I deleted. Whenever someone signs up for a class the data gets added to
a table called AddClientToRoster which has a RosterID and a CustomerID
field. The CustomerID field is blank for the ones I deleted but there are
still three records. Is there a way to delete all records from a table in
which the CustomerID field is blank?

Thanks,

Chuck
--
Chuck W


Sprinks said:
Chuck,

All you need is to requery the combo box. You can either do this as part of
the close AddCustomers form routine, or better, in the main form's OnActivate
event.

Me![YourSubform].Form![YourComboBox].Requery

Hope that helps.
Sprinks

ChuckW said:
Hi,

I have an access application that keeps track of people who sign up for
classes at a gym. There is a main form called BuildRoster that has drop down
boxes for things like instructor name and date and a subform called
AddToRoster that is continuous and has a drop down box for people who come in
for the classes. It is based on a query called CustomerQuery which is based
on a customer table. In addition, on the main form there is a button that
opens a form called AddCustomers that allows me to add names to the table.
So if a customer does not appear in my drop down list in the AddToRoster
form, I go to the AddCustomers form that allows me to add them. After I
close the AddCustomers form I am back at my main BuildRoster form and I click
on the drop down in the subform to select the name that I just entered.
However, they are not there. I have to actually close the entire BuildRoster
form and then reopen it. When I reopen it and click on the drop down in the
subform, the customer is there. Is there a way to get the customer to appear
in this drop down without having to close the form and go back in?

Thanks,
 

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

Similar Threads

Drop Down Combo Box Help? 1
Help with form drop downs 1
Drop down list 4
Drop down list 8
Value list updates not appearing in form 1
Drop down question 3
form question 5
Drop-down list in a form 1

Top