Bound Text Box - What's going on???

Jemmo

Registered User.
Local time
Today, 03:46
Joined
Jul 28, 2008
Messages
82
I have a form.
I have 2 tables - tblCountRecords, tblCountDuplicateRecords

Each table contains one row and a value

I have inserted a bound textbox into the form and the correct count value appears.

If I try and insert another bound textbox to display the other value, the first textbox value resets to '#Name?'

So it looks like I can have only one textbox bound to the form. Is this correct or am I being a nugget?
 
Are you trying to get the values from two different tables
 
Yes.
Two tables, two bound textboxes.

I am guessing I may as well use a listbox as the data is only to be viewed and not updated via the form.
 
How are you getting the data from two tables on one form is your form based on a query?
 
I am guessing I may as well use a listbox as the data is only to be viewed and not updated via the form.
Listboxes are not intended for displaying data; they're intended to be used when data needs to be selected! You need to figure out what is causing the problem you're now experiencing, not simply avoid it.

Is your form based on a query?

Exactly what are you trying to accomplish here? Having a form based on two tables, with each table only having one record with one field, is odd, to say the least.
 
The tables are there to provide a visual reconciliation of data.
One table is just a count of the records in an imported file.
Another table is the count of duplicate records.
And another one is the count of single occurrence data that can be number-crunched and more stats & costs calculated.

It's pretty straight-forward really.
I just want the text boxes to display a number.
 
Listboxes are not intended for displaying data; they're intended to be used when data needs to be selected!
That isn't actually true. Listboxes are perfectly acceptable to use for displaying data and I've used them very successfully for displaying the results of a search, etc. where I just need to display the data and don't need to edit the records. I've also done it where I display the results and then double click on the item in the listbox to open the item for editing.

As for showing data on a form from multiple tables, you can choose to do it in many different ways.

1. Use a Dlookup for each value you want to display (not recommended due to performance issues)

2. Use a query to bind to the form's recordsource and, if the query can display the distinct values required you can bind a control to each field. However, depending on whether the query is updateable, the fields are not necessarily going to be updateable.

3. Use a list box to display the results of the query.

4. Use subforms - one for each table you want to be able to edit.

And I'm sure that there are many other options too. I just can't think of them at the moment.
 
boblarson said:
That isn't actually true. Listboxes are perfectly acceptable to use for displaying data and I've used them very successfully for displaying the results of a search, etc. where I just need to display the data and don't need to edit the records. I've also done it where I display the results and then double click on the item in the listbox to open the item for editing.
If you look at what you quoted you'll see I said "Listboxes are not intended for displaying data." Doesn't mean you can't use them to display data. People do it every day. You can, in fact, display data in a combobox, if you want to, but that's not what the Access gnomes intended when they invented them! You can use a Datasheet form as a data selection device, using the double-click event of a field, but again that's not what the object is intended to be used for. My real point was that rather trotting off to use another dtype of display the OP should try to figure out what was going awry to begin with.
 
If you look at what you quoted you'll see I said "Listboxes are not intended for displaying data." Doesn't mean you can't use them to display data. People do it every day. You can, in fact, display data in a combobox, if you want to, but that's not what the Access gnomes intended when they invented them! You can use a Datasheet form as a data selection device, using the double-click event of a field, but again that's not what the object is intended to be used for. My real point was that rather trotting off to use another dtype of display the OP should try to figure out what was going awry to begin with.

And you know that they were not intended to be used that way HOW? Do you have some special relationship with the Access Dev team that lets you know that? I think that assumption canNOT be made as concrete as you have done.
 
And you know that they were not intended to be used that way HOW? Do you have some special relationship with the Access Dev team that lets you know that? I think that assumption cannot be made as concrete as you have done.
Because objects (such as comboboxes and listboxes) intended to be used to make selections with come with the properties needed to facilitate this function. Objects intended to be used to display data but not to select data don't come with these native properties. To my mind it's pretty straight forward, but that is, of course, just one man's opinion!

Have a great weekend, Bob!
 
but that is, of course, just one man's opinion!
Linq:

That's what I was getting at - it is different to express an opinion as an opinion, but to express it as fact is, perhaps, going a little too far maybe? We have to be careful at being too dogmatic unless there is truly a need to be dogmatic.

So, anyway, you have a good weekend too! :)
 
I couldn't see what was wrong and spent too long delving so in the end I used list boxes - quick and easy. And most importantly, in this case they work.

Thanks guys.
 

Users who are viewing this thread

Back
Top Bottom