Hi
Thanks for your reply. In this instance I would like to create s
new record in the same table. I have the following in the
database to pass information from one table to another
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Issues and Concerns"
strPassValues = Me.[Reference Number] & "~" & Me.Surname & "~"
& Me.[First Name] & "~" & Me.Town & "~" & Me.Address & "~" &
Me.[Address (2)] & "~" & Me.[address(3)] & "~" & Me.Postcode &
"~" & Me.[Telephone No:] stLinkCriteria = "[Reference
Number]=" & Me![Reference Number] DoCmd.OpenForm stDocName, ,
, stLinkCriteria, , , strPassValues
However adding this to a record opperation button where the DoCmd
is GoToRecord doesn't work. i.e the following
DoCmd.OpenForm , , , , stLinkCriteria, , , strPassValues
Do you have any tips for this?
Thanks again
Colin
Re-READ mr Linson's reply.
Boyce and Codd's rules for database design say you should only need
to pass one value to the new record, and that is the key value from
the the persons table. [surname], [first name], [town] and the other
values already exist and need not be passed, which is why Access does
not have an easy functionality to do this.
Besides, your code does not define the stLinkCriteria, which you
should not use attempting to add a record, but you should set the
Datamode parameter to the acFormAdd constant, so that Access knows
that it you want it to be going to a new record. You would use the
OpenArgs to pass the value(s) you need, but you need the form's on
load event to parse that (those) value(s) to the cointrols where they
belong.