Automaticaly fill fields

access2010

Registered User.
Local time
Today, 01:15
Joined
Dec 26, 2009
Messages
1,115
Could I please receive a suggestion on how to programmatically fill EMPTY fields on our form attached
.
The date entered into field "A" will be programmatically entered into the "B" and the "C" fields, * if the field does not contain any data *

The same for field "D" to be entered into "E" and "F" * if the field does not contain any data *

Your suggestions are appreciated

Mahi
 

Attachments

Looking at your previous posts you should be able to answer this yourself, easily.
There are dozens of examples here setting form values if another field is null or empty !
 
Not seen your previous post s, as a non professional i would approach it as follows :
#Private Sub Invoice_Date_AfterUpdate()

If (Me.Doc_Date) = "" Then
Me.Doc_Date = Me.Invoice_Date
End If

If Cheque_Date = "" Then
Me.Invoice_Date = Me.Invoice_Date
End If
End Sub#

And a simular code for your next for your C filds

It may not be the best example and others may have some input ,but appears work .
Regards Ypma
 
Thank you for your suggestion, the person who normally helps us with our programming is on sick leave and I am not knowledgeable about programming.
.
I have tried using this code for the B and C fields, =Nz([Invoice_Date])

.
This works perfectly if the B and C field is empty, but causes an error when the B and C fields already contain data (the field is overwritten)
.
Could I please receive a suggestion on how copy the field’s data ONLY if the receiving field is empty.
.
I do appreciate any assistance that is offered.
.
Fabiola
 
What error are you getting?

You probably need to check for Null and empty string ( "" )
If IsNull(Me.FieldB) or me.fieldB = "" Then me.FieldB = [me.InvoiceDate}
 
Confused by your last. where are you putting the =Nz([Invoice_Date])
As pointed out you need to check if the field is empty or not . My example should be copied to the after update and it only copies the date from A to B and C if the fiellds are blank , have you tried that ?i have returned your db so you can test
Ypma

 

Attachments

Thank you for your suggestions to Carry the Current Value of Field A to B and C
== IF B and C has No Value (is null or is blank as I do not know the proper word)

.
I am not a programmer (only a volunteer) and am getting a head ache from trying all the suggestions received and found.
.
Could someone please place working code into this database and upload the fixed working database?

Other wise I will manually enter the data as the charity I volunteer at has to have their books completed for audit before the first week Christmas.

.
Your assistance is appreciated
.
Fabiola
 
I have revisited and incorporated Minty suggestion of using Null .along with = ""
Test the code in the attached , after entering the data click to another field for the operation to work , hope this now works for you
Ypma
 

Attachments

Thank you for your code and for uploading our database.
.
Could our problem be that we are using MsAccess 2003
.
When running your adjusted database, we receive a Compile Error.
.
Nancy
 
Because your id is ACCESS2010 I assumed you were using that version , i will get to a 2003 version and come back to you.
 
Thank you for your note.
.
Paul who normally works with us uses Office 2010, but he is on sick leave and the office only has office 2003 software
.
Nancy
 
Perfect.
.
Leaving for the weekend in 40 minutes and looking forward to using your program on Monday.
.
Thanks again for your assistance.
.
Nancy
 
Thank you for your assistance and we have used your fixed database with SUCCESS

Thank you

Nancy
 
Nancy : Thank you for taking time out to report back , There are a number of very able people on the is forum and if you need assistance post a new thread , Plesse give details of the version your are using when posting . Best of luck

Bob
 

Users who are viewing this thread

Back
Top Bottom