table/Query as rowsource

  • Thread starter Thread starter mark R.
  • Start date Start date
M

mark R.

The user has a value to input and store which could be
positive or negative, depending on the user. At the time
they purchase the software, users choose whether the value
will be negative or positive. They would rarely, if ever,
switch the sign. On the form it looks like this:

- 4.00

But, should the need arise, I would like to give them the
option to change the sign, or at the time of installation,
they need to select - or +

So I thought I would have a table called SIGN, with one
field (THE_SIGN) (with a validation = "-" or "+" and only
one record (so it seems I needed to add a dummy field and
have no primary key, or else ACCESS offers a prompt for
more than one record).

I thought I could have a MAINFORM_SIGN field that in
LOOKUP had LIST, TABLE/QUERY, and Rowsource as (table)SIGN
or perhaps a query(whatsign). I can't get it to work.

My query
From Sign
Select The_sign


Of course, I could just have the default value for
MAINFORM_SIGN = "-" and let the user have a text box to
change the sign.........maybe that's better.

But I thought as a learning process, I'd pose this question
anyway
 
Shouldn't the query be the other way around? i.e.

SELECT The_sign
FROM Sign;

Aside from that, since it is a single-column table, can't
you just use the table name as the row source in the
property editor? As in:

[Field Name].RowSource = "Sign"

Also, if you set LimitToList to True, you won't need the
validation rule.

Try that and see if it works

Chris
 
Chris, thanks for trying.

I think my problem is complicated by the fact that the
input field is in a subform, so I can't seem to access the
property edit on a right click and set the rowsource to
SIGN, nor the limittolist.

(You are right about the query,of course, typo)

I am just about to go ahead and store the sign in the
table (that underlies the subform) and just not give it a
cursor queue.....if the user needs to change it, they'll
have to point and click, or buy a different version of the
ACCESS program that has SIGN with a d(+) default....

unless you come up with another idea.

PS if I set rowsource to SIGN in the underlying table, it
doesn't help. I tried to set a one to one relationship,
but the subform just showed the SIGN field as a separate
field on the front of every record and if you click on it,
it gets all funky in the subform.

Maybe I am not explaining the problem well enough either.

-----Original Message-----
Shouldn't the query be the other way around? i.e.

SELECT The_sign
FROM Sign;

Aside from that, since it is a single-column table, can't
you just use the table name as the row source in the
property editor? As in:

[Field Name].RowSource = "Sign"

Also, if you set LimitToList to True, you won't need the
validation rule.

Try that and see if it works

Chris
-----Original Message-----
The user has a value to input and store which could be
positive or negative, depending on the user. At the time
they purchase the software, users choose whether the value
will be negative or positive. They would rarely, if ever,
switch the sign. On the form it looks like this:

- 4.00

But, should the need arise, I would like to give them the
option to change the sign, or at the time of installation,
they need to select - or +

So I thought I would have a table called SIGN, with one
field (THE_SIGN) (with a validation = "-" or "+" and only
one record (so it seems I needed to add a dummy field and
have no primary key, or else ACCESS offers a prompt for
more than one record).

I thought I could have a MAINFORM_SIGN field that in
LOOKUP had LIST, TABLE/QUERY, and Rowsource as (table) SIGN
or perhaps a query(whatsign). I can't get it to work.

My query
From Sign
Select The_sign


Of course, I could just have the default value for
MAINFORM_SIGN = "-" and let the user have a text box to
change the sign.........maybe that's better.

But I thought as a learning process, I'd pose this question
anyway

.
.
 
Back
Top