How to keep text or value of a field the same...?

CyberMind

New member
Local time
Today, 23:28
Joined
Jan 28, 2009
Messages
6
I need some help with Access 2007... Actually, A LOT of help..xD So I made a form to enter data to a table. I think that it would be convenient for the user to have the text or value of a couple fields (CustomerCode, CustomerName, QuotationCode, etc.) the same after navigating to the next record. I don't know how to do this, I see that Access uses a macro for navigating to the next record. So, any help?
 
Hi,

Do you mean - when you go to a new record the data from the previous record is copied across?

If so i have done this recently so could probably help.

Regards
 
yes that is exactly what I mean! How did u accomplish that???
 
Hi,
This is what worked for me:

1. Create public variables (in the form code) of fields to be copied e.g. Public StrCustomerCode As String, StrCustomerName As String, StrQuotationCode As String

2. In the AfterUpdate of each field add the value to the variables e.g.

If Not IsNull(Me!CustomerCode ) Then
StrCustomerCode = Me!CustomerCode
End If

3. In the BeforeInsert of the form check the variables e.g.

If StrCustomerCode <> "" And IsNull(Me!CustomerCode ) Then Me!CustomerCode = StrCustomerCode

This only works if you have entered data in to the fields and then start a new record - the variables will be emptied when the form is closed.

Hope this helps :)
 
It sounds like all you need are subforms. The data you want to carry across relates to one record ... let's say Client A. This information would be located on the parent form.

The 'records' of Client A (invoices, etc) would then be captured in the subform (via a child table relationship). You can then navigate through the records in a subform and the main form is still the same form.

If you are duplicating all of this client information then you are not making the best use of your resources and violating normalization standards. Here is a link that goes into some tutorials about subforms, etc ....

http://www.techonthenet.com/access/index.php

-dK
 

Users who are viewing this thread

Back
Top Bottom