Need same form open with different recordsets.. sometimes...

F

Fred Boer

Hello:



My small library application has a form to enter/edit book information.
(Table structures below.). When the application opens, code runs to see if
there are any books in the table without any corresponding author(s) listed
in the author table. If so, the user is offered the option of correcting the
problem. Choosing this option opens the form with a recordset restricted to
the offending records.



In order to return to normal use of the form, the user has to close, and
then reopen the form. It isn't obvious to the user, however, that this is
necessary.



I could, I suppose:



1. Pop up a messagebox as the form with restricted recordset opens, telling
user that they need to close this form and reopen it (easy to do.).

2. Reveal a hidden label on the form which provides the same information.

3. Reveal a hidden command button on the form which would reset the
recordsource of the form to normal when clicked.

4. Something else.



I'm just toying with these options. There isn't much space on the form for
new labels or command buttons, and the user might not notice them unless
they become unavoidable - and intrusive. I suppose I am leaning to the first
option, but I'm open to suggestions. I suppose I could just use two forms;
but the forms would be *exactly* the same except for the recordset. Would it
be possible to open a second instance of the form? Could the form check for
existing instances of itself, and open a second instance or something?



Cheers!

Fred Boer





Tbl_Library



BookID

Title

Dewey Number

Etc.



Tbl_Author



AuthorID

AuthorLastName

AuthorFirstName

Etc.



Tbl_BookAuthor



BookAuthorID

BookID

AuthorID
 
D

Douglas J Steele

Not sure I fully understand the setup, Fred.

Why do they have to close the form and reopen it? If the only difference is
that it's a different recordset, my vote would be to give them a button that
resets the recordset. You could use that button to let them toggle into the
"restricted" mode any time they want, should that be of any use. You could
use different form background colours, for instance, depending on which mode
they're in. Most of the properties like Caption, BackColor and so on can be
set through VBA, thus eliminating the (ugly) option of having two
essentially identical copies of the form.

And yes, it's possible to have multiple instances of the same form open at
the same time. Allen Browne talks about this at
http://www.allenbrowne.com/ser-35.html
 
F

Fred Boer

Thanks for responding, Doug!

Sorry if I wasn't clear..

As it is now, the user has to close the form because the form is opened (in
code, in response to a messagebox) with the restricted recordset. Closing
the form and re-opening it (via the menu system) causes the form to reopen
with the standard, complete recordset. And, yes, the only difference is the
different recordset. Good idea about the different background colours; I
hadn't thought of that!

Thanks!
Fred
 
B

Brian Bastl

sorry to butt in, but could you just use

Me.FilterOn = False either behind a cmdButton (if you want to edit
multiple records) or in the Form's AfterUpdate event?

Brian
 
F

Fred Boer

Thanks!

Yes, I could do something like that, for sure. However, I'm not really
concerned with the mechanics of changing the recordset, but more with the
way the user is made aware of the *need* to change the recordset, and with
the method that they would use to take that action... So, as per Doug's
suggestion.. a differently coloured form, perhaps, with a command button..

Thanks!
Fred
 
D

Douglas J Steele

Just to be clear, what I was suggesting was a single form with a toggle
button that when you pressed it would set the form's RecordSource property,
its BackColor, its Caption and whatever you want. When you release it, it
would reset those properties.

Realistically, you could simply use a label (they have a click event)
instead, or a button and keep track of what state you're currently in.
 
F

Fred Boer

Hi Doug:

Yes, I understood that - and I think it will would work fine...

Thanks again!
Fred

P.S. But I'm also tempted to play with opening multiple instances of the
form (as per Allen's webpage). There isn't a lot of code, and it doesn't
*look* too hard, and it would sure be a neat thing... although I can see the
vultures of Overconvidence perched all around me on the bookshelves, waiting
patiently....
 

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