Cannot edit text box

S

scrawf

Hi all,

I've got a problem. I've set the forms record source to a select query
that takes the latest record in a table then I've setup some text boxes
that display that record. I want the users to be able to edit those
text boxes displaying the information so that a button can add another
record with the new information contained within it. For some reason
it won't let me make any modification to the text box. is there some
property that I've set wrong or some way I can allow the text box to be
edited without having to set up another button that clears the values
of the box?

Cheers,

Scott
 
V

Van T. Dinh

There are a number of Form settings that can affect this ... However, my
first suspicion is that the Query being used as Form's RecordSource is not
updatable ...

Open the DatasheetView of the Query and see if you can update / add the data
.... If you can't, you will need to modify the Query to become updatable.
 
G

Guest

Hi scrawf,

Do you have the Text Box bound to a field from your select query? Is your
query written in such a way that you can update records? Try running the
query on its own and changing data to answer the second question.

Hope this helps.

Damian.
 
B

Bob

I can't modify the query, but I don't want to modify the query anyway.
I only want to be able to edit the text box then when a user clicks a
button I will add a record to one of the underlying tables then refresh
the form with the query which will then reflect the change. The reason
why is because I'm selecting the last record from a table (going by a
timestamp) to show up in the form. What would you suggest is the best
way to get the data from the table in the form without it being updated
to the query?
 
B

Bob

Hey its still scrawf, but I changed my name to bob:

I can't modify the query, but I don't want to modify the query anyway.
I only want to be able to edit the text box then when a user clicks a
button I will add a record to one of the underlying tables then refresh

the form with the query which will then reflect the change. The reason

why is because I'm selecting the last record from a table (going by a
timestamp) to show up in the form. What would you suggest is the best
way to get the data from the table in the form without it being updated

to the query?
 
S

Steve Schapel

Scott,

When you say "the latest record in a table", does that mean you are
using a Totals Query to return the data for your form? I.e. using a
Group By? If so, this will be enough to render the query
non-updateable. You will need to find another way to achieve your
purpose. Such as, for example, basing the form on the whole table, and
then moving the focus to the last record. Or, using a In(SELECT
Max(...)...) type of construct in the query, in the criteria of
whichever field you use to determine which is the latest.

Hope that helps. If you need more explicit advice, can you please post
back with some more specific details?
 
B

Bob

Hi Steve,

Thanks for the help, but I've still got some issues...
I've set it up so that my form opens the table and looks at the last
record on activation and now I can edit the text box but it will
automatically edit the table. I don't want to automatically edit the
table, I want to display the values from the last record in the table,
then I want a user to be able to edit those values and then add those
figures to a new record in the table (without updating the last record
in the table.. how do I do that?

Also, I want the percentage to be able to be entered as a whole number,
not a decimal, so 10% can be entered as 10, not .10, how can I do that?
 
S

Steve Schapel

Bob &/or Scott,

Well, you can't edit the record without editing the record.

It might work to think of it the other way around... First add a new
record to the table that duplicates the values in the last existing
record, and then edit the newly added record as required.

I still don't know what you mean by "last record". Do you have a field
that shows the date/time the record was created, or a, incremental
numbering field, or whatnot, that can be used to identify the last
record. Whatever, you can make an Append Query based on this record, in
order to add a new record to the table, and then open the form to
display this record, which will now be the "last", right?

You can't directly enter 10% by just entering 10. 10% is not 10, 10% is
..1, or else you can actually type in 10%. Having said that, I suppose
you could use code on the AfterUpdate event of the contol on the form,
the equivalent of this...
Me.YourPercentField = Me.YourPercentField / 100
I can't really envisage too much problem with this, unless someone tried
to edit a previously entered figure.
 

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