list box

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

maan via AccessMonster.com

i am having a problem in putting my newly added data in the list box. my list
box does not show on the first column the 1st data that i have entered. i
have a command button to add my data in the list box and i am using this code:

DoCmd.OpenQuery "new_SY"
Me.cmborgsname1.Value = Null
Me.Active.Value = Null
Me.SchoolYear.Value = Null
Me.listactiveorgs.Requery

and the codes for my list box is:
Me.Orgsname.Value = Forms!Form1!listactiveorgs.Column (0)
Me.Active.Value = Forms!Form1!listactiveorgs.Column (1)
Me.SchoolYear.Value = Forms!Form1!listactiveorgs.Column (2)

my list box does not show the orgs name. what went wrong?
thanks!
 
J

Jeanette Cunningham

Hi,
let's look at the line DoCmd.OpenQuery "new_SY"
When a form is open, it is very unusual to open a query.

I can't see your form, so this a guess.
Instead of DoCmd.OpenQuery "new_SY"
-- in design view
--select the listbox
--on the property dialog | Data tab
--next to Row Source
--type in "new_SY"

Now delete the line DoCmd.OpenQuery "new_SY"
Save and close the form, run the form.

What is the recordsource of the form?

Jeanette Cunningham
 

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