Lost data?

F

Fluke

Hi.

I've got a main database, and I've created a separate deferment database
that's linked (in a different front end) to the main by Item, as the
deferments are based on items in the main database. The forms in the
deferment database front end are based on queries where the Item field is
from the main database, then the rest of the fields are the deferment ones.

If you filter on certain items, and have a found set of however many (but
more than one) and enter data in the fields, move on to the next record and
then go back, the data is saved. If you filter on just one record, put in
data, then go to filter on another one, the data isn't there.

I've discovered that the entered data is actually saved in the deferment
table, but it's not creating the link, with the Item field in the main
database if you just filter, enter data, then filter again - but it does if
you move onto a new record.

i hope that makes sense, but can someone help?
 
L

Lord Kelvan

it is because you are not saving the record or confirming the record
is saved when you move from record to record it saves it this is
normal database functionality

basically you shouldnt be doing updates from the back end you should
be using forms to do changes with a save button or some code to save
it.

Regards
Kelvan
 
F

Fluke

Hi.

The updates are being done using forms. And the data is being saved - it's
there when I look in the table. But it's just not putting the ITEM number in
so the link to the main database isn't there.

I did have it done using subforms, but changed it to a query so people could
search easily.
 
J

John W. Vinson

Hi.

The updates are being done using forms. And the data is being saved - it's
there when I look in the table. But it's just not putting the ITEM number in
so the link to the main database isn't there.

I did have it done using subforms, but changed it to a query so people could
search easily.

Users should NEVER see query datasheets. This is a good example of why they
shouldn't!

A Query (unlike a Subform with a master/child link field) will not and cannot
automagically determine which parent record should be referenced. The foreign
key field will NOT automatically fill in if the user enters data for other
fields. That's why you're losing the link - it's never being entered in the
first place!

I'd really suggest using a form with a subform, and providing the user with
form tools to search the tables; it is NOT necessary to have a query design
window (or even a query datasheet) open to do searching.
 
F

Fluke

Hi John.

That was how i originally had it, with the subform, but then you can't
easily search on any fields in the subform like with filter by form for
example. That's why I changed it to the one based on a query.

Do you have any suggestions please?
 
J

John W. Vinson

Hi John.

That was how i originally had it, with the subform, but then you can't
easily search on any fields in the subform like with filter by form for
example. That's why I changed it to the one based on a query.

Well, I agree you can't "easily" - but you can with a little code. You could
have parameter textboxes on the form and a command button to search the table.
If you'ld like to post some details of your table structure (perhaps the SQL
of your join query would suffice) I could suggest some code to get you
started.

If you want the users to have the query datasheet, then you must deal with the
fact that they have the query datasheet, warts and all!
 

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