Changing Listbox RowSource

daninthemix

Registered User.
Local time
Today, 07:58
Joined
Nov 25, 2005
Messages
41
Hey all,

I have a number of listboxes in a form who gather data about the main field in that form, so they are bound to queries etc.

The thing is, I have a routine that allows users to create new records, and in that instance the following code runs:

'[Forms]!customers.lstOpenCalls.RowSource = ""
'[Forms]!customers.lstClosedCalls.RowSource = ""
'[Forms]!customers.lstAssets.RowSource = ""
'[Forms]!customers.lstLogins.RowSource = ""
'[Forms]!customers.lstCarePacks.RowSource = ""
'[Forms]!customers.lstConfigs.RowSource = ""
'[Forms]!customers.Customer = NewCustomer
'[Forms]!customers.[Address 1].SetFocus

(without the 's of course). This is so that those listboxes don't have old data in for the new record. The problem of doing things this way is that the rowsource is then permanently changed and my queries are lost, as I found out to my annoyance! Is there a better way of doing this?
 
You could disable saving the form (properties) on close
You could requery the controls for each new record so they would repopulate
You could just set them to a new default

just of the top of me head
 
FoFa said:
You could disable saving the form (properties) on close
How?
FoFa said:
You could requery the controls for each new record so they would repopulate
Already had a load of requeries in the form's current event. Doesn't seem to work!
 

Users who are viewing this thread

Back
Top Bottom