linking record questions

  • Thread starter Slez via AccessMonster.com
  • Start date
S

Slez via AccessMonster.com

I have 2 questions:

1. On a subform, I have a command button which opens another form via macro.
What is the proper way to link the records on that form to a control on the
main form?

2. In an attempt to accomplish the first question, I was at a point where
the records were actually related, however it would not allow me to add new
records. I got the error message: "Primary key cannot contain a null value..
" How do I make the related field take on a matching value to the main form?

Any feedback is appreciated!
 
M

Marshall Barton

Slez said:
I have 2 questions:

1. On a subform, I have a command button which opens another form via macro.
What is the proper way to link the records on that form to a control on the
main form?

2. In an attempt to accomplish the first question, I was at a point where
the records were actually related, however it would not allow me to add new
records. I got the error message: "Primary key cannot contain a null value..
" How do I make the related field take on a matching value to the main form?


In most situations, the best way to filter a form when you
open it is to use the OpenForm method's WhereCondition
argument. The general idea is:
DoCmd.OpenForm "anotherform", , , "somefield=" & sometxtbox
 
Top