By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,469 Members | 2,402 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,469 IT Pros & Developers. It's quick & easy.

Assigning default values from previous record

P: 1
Microsoft Access

I am a newbee, so this may be a stupid question, but I will ask anyway. I have a form "Month1" and a linked subform "Monthlystuff" linked by a textfield "Month" and I placed in code that allows me to autopopulate the the next record with fields that remain the same from month to month. However, when I do this the linked field "Month" auto populates as well and when i go to change information on the record the previous' record's info gets changed as well. Is there any way to have it so that the new record can be edited without changing the old record? Here is the code that I am using for the default value assignment:

CODE STARTS HERE
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeInsert(Cancel As Integer)
  2.     Dim strMsg As String
  3.     Call CarryOver(Me, strMsg)
  4.     If strMsg <> vbNullString Then
  5.         MsgBox strMsg, vbInformation
  6.     End If
  7. End Sub
CODE ENDS HERE

If anyone can help I would really appreciate.
Liquid
Feb 12 '07 #1
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,186
I'm afraid that with a question like this it's important to understand the details. Unfortunately these are not stated very clearly here so I'm not sure exactly how to help.
Could you post the MetaData for the Record Sources of the two forms (main & sub) as well as trying to explain more precisely which of the forms you're referring to when you say things like :
...and I placed in code that allows me to autopopulate the the next record with fields that remain the same from month to month. However, when I do this the linked field "Month" auto populates as well and when i go to change information on the record the previous' record's info gets changed as well.
Feb 12 '07 #2

Rabbit
Expert Mod 10K+
P: 12,315
We also need to know what CarryOver() does.
Feb 13 '07 #3

NeoPa
Expert Mod 15k+
P: 31,186
It looks like I forgot to post an example of table MetaData. Here is an example of how to post table MetaData. Feel free to Reply to my post and use the formatting commands that are embedded in my version (The Bolds; the Codes etc) :
Posting Table/Dataset MetaData
Expand|Select|Wrap|Line Numbers
  1. Table Name=tblStudent
  2. StudentID; Autonumber; PK
  3. Family; String; FK
  4. Name; String
  5. University; String; FK
  6. MaxMark; Numeric
  7. MinMark; Numeric
Please also respond to Rabbit's post below.
Feb 13 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.