Can't get data entry with a form based on a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Have a simple database, 1 table, I used a query to load a form so that only
the records fitting certain criteria are seen, but how can I update records
from the form?
 
First, if you have only one table, it really isn't a database, it is more
like a spread sheet. You might want to look at database modeling and see if
your data can be more efficiently set up at some point.

If your form is based off of a query, then even if you used the wizard to
create the form, to update the data, all you need to do is change the data in
the form. Unless I misunderstand, I just created a very small two table
database with only names/ID and departmentsDeptID. I updated information by
just changing it. If you are not the only one using this form, you may want
to build in some protection to prevent others from making corrections.
 
Joe said:
Have a simple database, 1 table, I used a query to load a form so
that only the records fitting certain criteria are seen, but how can
I update records from the form?

Make sure View Totals is not turned on it the query. A query against a
single table will usually be updateable as long as you are not doing any
aggregation.
 
geomike.. well, not exactly one table...4 tables, something like this...
Main table is for projects...
fields are:
autonum, date1, text1, memo1, date2, text2, memo2, date3, text3, memo3,
date4, text4, memo4 and 4 yes/no fields
I used the wizard to create 3 queries...
Query1 - if date1 or text1 is not null, it shows all fields thru text2
Query2 - if date2 or text2 is not null, it shows thru text3
etc.
The other 3 tables are used to print out values in a report according to the
values in the text fields.
Then I used the wizard to create forms...
Form1 is for entering data into the date1...memo1 fields
Form2 (based off the query1) is for entering data in date2...memo2 fields
Form3 is based off query2
Form4 etc.

I can enter data into Form1, I'm guessing cause the field values are right
from the table, but I can't enter data into Form2, I guess because it's based
off the query.

So that's where I'm stuck, 3 forms I can't enter data on...

Thanks in advance for any ideas.
 
Take a look at how you have your txtBoxes set up. If you can update the
query, and the form is based on the query, then you should be able to update
the form, unless you have something conflicting in the way you have the text
box properties. We have had connectivity issues all day, I really hope this
helps.
 
Geomike, I have looked at these things and compared everything to everything,
Query1 is editable through the query and the form, query 2 and 3 are not
editable either way. I sincerely appreciate your help with this, I am
starting to have nightmares about it.
 
Joe,

Have you ever used recordsets or Visual Basic? It could be possible that
you need to go about your other two forms in another way. How many tables
are they based off of? I have created tables from queries before that are
not updatable. Possibly this is the case. If you can not update the query,
I would bet my pda that you will not be able to update the form based on the
query either. If this is so, I would bet that a recordset would be a good
choice. I am using recordsets on some forms now. In fact, I have been
coming to the communities to try and work out a SQL insertion method for VB.
HTH, at least a little. Do you have any of the developers examples that come
with Access? There may be a good example of using recordsets. I based mine
 
Geomike,
Haven't used VB before, my programming is limited to C++ and I can work SQL
fairly well. Do you know where/how I could get the developers examples? I'll
do a search after I post this so I may find something out... The forms are
only based off of 1 table, the other tables are for report data.
Thanks Again.
 
Geomike...I got frustrated and went through my queries again...I had one
field from another table in the query so that we could see what the field in
table 1 represented... I removed the linked field and the table from the
query and now everything is working the way I thought it was going to in the
first place... so my big lesson for the year... don't base forms on a query
of more than 1 table. (Although it could probably be done with subforms, but
that's a different subject and I don't even want to go there.)
Thanks Again for ALL your help.
 
Back
Top