Can't add any records...

T

Tara

I posted this a few days ago, but since I didn't get any responses, I thought
I'd repost.

I have desiged a form that is set up to show any open cases for any given
individual by clicking on a command button and to show any closed cases for
that individual by clicking on a different command button. I had assumed
that if I navigated to the desired person on the "main form", then opened the
command button for open cases, I could add any new cases for that person from
there. However I keep getting the error message "You cannot add or change a
record because a related record is required in table "TblClientContactInfo"
(The table the first form is based on). The form that is opened by the
command button is filtered through an Id number common to both forms, so I'm
not sure what the issue is.

Any help is appreciated! Thanks!!

Tara
 
K

Klatuu

It sounds like you have cases in a table related to individuals and the
relationship is one individual to many cases. In this situation, using two
forms becomes problematic. I would suggest you change your design to put the
cases in a sub form. You could still select open or closed cases in include
in the subform.
 
T

Tara

Thanks for the response! You're right about the way the relationship is set
up. I thought this might be a problem, but I really wanted to get away from
the *look* of a subform. I know I can make subforms look more like
traditional forms by setting Visible conditions and I'm willing to do that if
I have to. The only problem with that is that the user can still see the
navigation buttons from the main form. I'm afraid it might confuse some of
them. Is there a way to make those navigation buttons (on the main form)
invisible when I make the subform visible? I guess I could get rid of the
navigation buttons and add command buttons to navigate through records
instead, but I'd rather not unless I have to.

Thanks!!
 
K

Klatuu

I guess you could do that by setting the Record Selector and Navigation
buttons properties of the main form to False, but you would also have to
change them back to True when you move from the sub form back to the main
form.
 
T

Tara

Thanks Klatuu. I thought of that and tried it just before checking back in
here and it seems to be working well. Now, for one last thing. I would also
like to hide the command button that I use to open the subform once the
subform becomes visible. I tried some simple code, but I keep getting the
message "You can't hide a control that has the focus". Any quick tips for
getting around that?
 
K

Klatuu

That is true. You can't hide a control that has the focus. I would try
putting the code to hide it in the first control of the subform that gets the
focus.
 
T

Tara

Well, that makes sense. I guess I just wasn't thinking. Thanks for all your
help Klatuu. I think my issues are resolved now!

Tara
 

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