Senin, 20 Februari 2017

Re: [MS_AccessPros] Need help with VBA procedure

 

If you have Default Value defined in either the underlying table or in the form controls, those values will always appear on a "new" row.  This is normal behavior.  Your code apparently grabs the latest value entered to make it the default for the next new row - a common technique on a form designed to handle data entry for batches of data.


John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Feb 19, 2017, at 11:41 PM, kenaf42@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



Access 2010

On Form among several fields, four fields (PayDate, Time, PaidTo, and PaidFor) have the following procedures Before Update Event. 

If Not IsNull(Me.PayDate.Value) Then

 PayDate.DefaultValue = "#" & Me.PayDate & "#"

End If

"To save space I just typed the first procedure."

 

And I have Button on the form with Embedded Macro:

OpenForm

            Form Name        SData

                      View          Form

         Filter Name               

Where Condition

          Data Mode          Add

  Window Mode              Normal

 

Problem is when I open a new form in add mode with this button all four fields already have data that I could not find them in all relate tables and quires to this form.

How can I prevent this problem?


 





__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar