Having a problem editing data in a different table

  • Thread starter Thread starter John Doe
  • Start date Start date
J

John Doe

This seemingly simple database has been giving me real problems. I
don't know much at all about programming in Access and the MS website
is extremely difficult to use as a source for learning.

Here's my basic situation...

I am creating a database to keep track of the reviews that are
performed on documents (it's a metrics database). A document can be
reviewed multiple times before it finally gets approved.

So I have two tables. One has the document data. The other has the
review data.

First the user logs in a new document. That's on one form. Then the
user can log a review of a received document by using a second form.
That second form lists all the documents that are eligible for review,
the user selectes one, and that "creates" a new review of that
document. (Then on other forms they can add other information but
that's not the problem here.)

One thing that is needed is that on the Reviews form the user may find
that they need to change some of the original information about the
document. I have the documents displayed in a list box and the user
just clicks on a line to select a document. There needs to be an
ability for the user to edit that document from this form.

I tried to use a subform to display the document since there is a
one-to-many relationship of documents-to-reviews. But I couldn't seem
to get things working correctly.

So I finally put together another form for editing a document's
information. Now the user can double-click on a document in the list
and that will bring up the document information in a third form. The
user can edit the information and then return to that second orm (the
Reviews form).

At that point the list box needs to be refreshed with the new
information, and the current record needs to be the one that was just
edited.

What I can't figure out is how to get the current record to be the one
that was just edited. Once the list box is refreshed there is no
document selected at all. Actually I close the Reviews form to go to
the Edit form and then reopen the Reviews form when I come back.

I think I'm making this way harder than it needs to be but I have
spent hours on the MSDN website trying to figure out recordsets and
subforms and all that with no success.

Any suggestions on maybe a different solution implementation or maybe
some pointers to someplace that is a good place where I can LEARN
Access so I can figure this out?
 
It is hard to give you any specific advice because I understand so little
about your application. I guess you will have to write some VBA code in your
forms to meet your needs. It seems like you are familiar with events and
eventhandling?

If you need to find your record after a requery (refresh) of your form, you
may use vba-code like DoCmd.GoToRecord or DoCmd.FindRecord to find the
record in question (see help for description). In this case you need to
store some information about the record you want to find, typically the
value of the records primary key. For this information to survive a
close/reopen or requery of your form, you may declare a public variable
outside your form (in a module) to hold the value.

When it comes to the listbox (or combobox), I usually dont bother to find
the old contents. On the combobox AfterUpdate event I write its contents
into some textbox or into the forms caption.

You can contact me on gylveratonlinedotno.

Regards

Tore G
 
I know it's hard giving specific advice about something when you are
not given much info about it. I am willing to do the work to find out
information on how to program in Access, it's just that I have spent
so many hours on the MSDN website and it's so hard to find any
information there that pertains to my use of Access. There's plenty on
..NET, FoxPro, Office, etc., etc. Then what happens is that I finally
stumble across something useful and I'll forget it after a few days -
so good luck trying to find it again. Grrrr.....

I've also tried some classes and they are pretty basic. They give the
usual stuff about putting together the "Hello World" database and all
that. Same with the couple of books I've tried.

And I'm sure that my problems are mainly due to me being so unfamiliar
with programming in Access. I know a fair amount about programming and
about databases and object-oriented applications and all that. I just
don't know how to do the things I want to do in Access -- you know,
the syntax of the language. And the MSDN VB Language Reference doesn't
help unless you already KNOW the language. I have plenty of VB code in
my forms and probably if anyone who was really good at Access were to
see my application they would say, "Why in the world would you want to
do it THAT way????" So I'm sure it's all my own lack of knowledge -
I'd just like to know where I can get more knowledge.

Anyway, I'm just venting. Thanks for the tips. I'll see if I can find
some info on how to try them out.
 
Back
Top