Forums
This topic is locked
Binding data to a List/Menu field
Posted 30 Jul 2001 15:57:39
1
has voted
30 Jul 2001 15:57:39 Davy Fennell posted:
I am having problems binding data to a List/Menu field in one of my forms.I have set some values in the List Menu for users to select. However, when the form is displayed the values in the database don't appear in the field.
Can I set the Bind values to override the set List/Menu options.
Thanks.
Replies
Replied 30 Jul 2001 17:34:38
30 Jul 2001 17:34:38 Joel Martinez replied:
is the query actually returning records?
try doing a simple repeat region on the recordset just to see if there are records...
Joel Martinez
----------
Is this thing on?....
try doing a simple repeat region on the recordset just to see if there are records...
Joel Martinez
----------
Is this thing on?....
Replied 30 Jul 2001 19:22:00
30 Jul 2001 19:22:00 Davy Fennell replied:
The query does not return a record. However it does return a record if I change the field to a simple text field.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
is the query actually returning records?
try doing a simple repeat region on the recordset just to see if there are records...
Joel Martinez
----------
Is this thing on?....
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
is the query actually returning records?
try doing a simple repeat region on the recordset just to see if there are records...
Joel Martinez
----------
Is this thing on?....
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 30 Jul 2001 19:39:42
30 Jul 2001 19:39:42 Joel Martinez replied:
well, I don't know if I'm understanding this right, but if there is no record returned, then a value wont be displayed...
once you get your query working (to return values) you should be able to go to your SB floater, and find
dynamic elements > dynamic list/menu
then apply that to a listbox and be on your way... but like I said, I may be misunderstanding your problem.
Joel Martinez
----------
Is this thing on?....
once you get your query working (to return values) you should be able to go to your SB floater, and find
dynamic elements > dynamic list/menu
then apply that to a listbox and be on your way... but like I said, I may be misunderstanding your problem.
Joel Martinez
----------
Is this thing on?....
Replied 31 Jul 2001 12:31:45
31 Jul 2001 12:31:45 Davy Fennell replied:
I'm a little confused myself. Here is a clearer explanation. I have two forms, one an insert and the other an update. They both contain the same fields. The update form updates the record created by the insert form etc etc.
The insert form contains a List/Menu field that allows the user to choose from a selection of values set up in the "List Values" option of the List/Menu field properties. This works fine and inserts the appropriate data.
The update form contains the same fields and displays all the data as it should do. The problem I have had is to do with the menu items from the List/Menu drop down list. In the Insert screen the menu items were created in Properties - "List Values". If I do the same with the Update screen the List Value menu items appear several (blank) rows down the menu (Previously I thought they did not appear until I scrolled down and there they were!!??).
So, I guess my problems are:
1. Do I set the menu items up in the List Values of Properties or do I create a seperate table in Access.
2 If i do set the menu item in Properties how do I prevent them appearing several blank rows down the list.
Hope this is clearer. If not, don't worry.
Thanks again,
Davy
The insert form contains a List/Menu field that allows the user to choose from a selection of values set up in the "List Values" option of the List/Menu field properties. This works fine and inserts the appropriate data.
The update form contains the same fields and displays all the data as it should do. The problem I have had is to do with the menu items from the List/Menu drop down list. In the Insert screen the menu items were created in Properties - "List Values". If I do the same with the Update screen the List Value menu items appear several (blank) rows down the menu (Previously I thought they did not appear until I scrolled down and there they were!!??).
So, I guess my problems are:
1. Do I set the menu items up in the List Values of Properties or do I create a seperate table in Access.
2 If i do set the menu item in Properties how do I prevent them appearing several blank rows down the list.
Hope this is clearer. If not, don't worry.
Thanks again,
Davy
Replied 31 Jul 2001 15:09:52
31 Jul 2001 15:09:52 Joel Martinez replied:
ok, I think I understand... the person chooses an option from the insert screen, then you want the value to be selected on the update screen...
OK, there really is no easy answer to this one... but I had the same issue a couple of days ago in fact... I solved it with a bit of coding.
lets say you have a list box that looks like this<pre id=code><font face=courier size=2 id=code><select name="excuses">
<option value="1">dog ate homework</option>
<option value="2">mom is on crack</option>
<option value="3">I was abducted by aliens</option>
</select></font id=code></pre id=code>then say you have a recordset named <b>rs</b>. you would change the list code to look something like this:<pre id=code><font face=courier size=2 id=code><select name="excuses">
<option value="1" <%if rs.fields("excuses".value = 1 then response.write "selected"%>>dog ate homework</option>
<option value="2"<%if rs.fields("excuses".value = 2 then response.write "selected"%>>mom is on crack</option>
<option value="3"<%if rs.fields("excuses".value = 3 then response.write "selected"%>>I was abducted by aliens</option>
</select></font id=code></pre id=code>as you can see, if the value of the record is 1, then it will write "selected" thus making that option the default visible one.
hope that was your problem,
Joel Martinez
----------
Is this thing on?....
OK, there really is no easy answer to this one... but I had the same issue a couple of days ago in fact... I solved it with a bit of coding.
lets say you have a list box that looks like this<pre id=code><font face=courier size=2 id=code><select name="excuses">
<option value="1">dog ate homework</option>
<option value="2">mom is on crack</option>
<option value="3">I was abducted by aliens</option>
</select></font id=code></pre id=code>then say you have a recordset named <b>rs</b>. you would change the list code to look something like this:<pre id=code><font face=courier size=2 id=code><select name="excuses">
<option value="1" <%if rs.fields("excuses".value = 1 then response.write "selected"%>>dog ate homework</option>
<option value="2"<%if rs.fields("excuses".value = 2 then response.write "selected"%>>mom is on crack</option>
<option value="3"<%if rs.fields("excuses".value = 3 then response.write "selected"%>>I was abducted by aliens</option>
</select></font id=code></pre id=code>as you can see, if the value of the record is 1, then it will write "selected" thus making that option the default visible one.
hope that was your problem,
Joel Martinez
----------
Is this thing on?....
Replied 01 Aug 2001 13:46:07
01 Aug 2001 13:46:07 Davy Fennell replied:
Unsure what's happened but it seems to work now. The bound data displays (as well as the menu options) in a nice neat list.
However on one or two other records it still displays the data underneath that particular column in the database. Blanks included.
I think this maybe a data issue rather than a UD problem.
Things are OK for now. Thanks for your help.
Davy
However on one or two other records it still displays the data underneath that particular column in the database. Blanks included.
I think this maybe a data issue rather than a UD problem.
Things are OK for now. Thanks for your help.
Davy