Newbie form problem

  • Thread starter Thread starter Stephen
  • Start date Start date
S

Stephen

Greetings all

I have a table that is populated by a form called main. I want to place a
button to call up another form to continue to input data to the same record.
When i click the button to call the form, the record pointer seems to shift
to the beginning of the file...

any help would be appreciated

thanks
 
Stephen,

you need to tell access which record to filter on.

dim stWhere as String
'for numeric datatype
stWhere = "[NameOfPrimaryKeyInUnderlyingTable]=" &
Me!NameOfPrimaryKeyControlOnForm
'or for text datatype
stWhere = "[NameOfPrimaryKeyInUnderlyingTable]='" &
Me!NameOfPrimaryKeyControlOnForm & "'"
DoCmd.OpenForm "YourForm",,,stWhere

Obviously you'll need to replace my generic names with yours.

HTH,
Jeff
 
Thank You

This work perfectly

Steve
JeffW said:
Stephen,

you need to tell access which record to filter on.

dim stWhere as String
'for numeric datatype
stWhere = "[NameOfPrimaryKeyInUnderlyingTable]=" &
Me!NameOfPrimaryKeyControlOnForm
'or for text datatype
stWhere = "[NameOfPrimaryKeyInUnderlyingTable]='" &
Me!NameOfPrimaryKeyControlOnForm & "'"
DoCmd.OpenForm "YourForm",,,stWhere

Obviously you'll need to replace my generic names with yours.

HTH,
Jeff

Stephen said:
Greetings all

I have a table that is populated by a form called main. I want to place a
button to call up another form to continue to input data to the same record.
When i click the button to call the form, the record pointer seems to shift
to the beginning of the file...

any help would be appreciated

thanks
 
Back
Top