Senin, 25 November 2013

Re: [MS_AccessPros] On form data entry desired fields input fills new row

 

Hello Graham,

Thanks a lot, the solution which emerged from your wealthy pocket did served my purpose perfectly with the following code:

Private Sub ProductName_AfterUpdate()
    If Me.NewRecord Then
        ProductName.DefaultValue = Chr(34) & ProductName & Chr(34)
    End If
End Sub

Get ready to fill your pockets with more stuff, i will be back with a new demand.

Once again Thanks & regards,

Khalid


On Monday, November 25, 2013 1:34 PM, Graham Mandeno <graham@mandeno.com> wrote:
 
Hello Khalid
 
I am not John, but I hope I have a solution in my pocket that might serve your purpose ;-)
 
Attach an event procedure to the AfterUpdate event of your combo box which checks if you are on a new record and, if so, sets the DefaultValue of the combo box to the newly selected value.
 
Something like this:
 
Private Sub ProductName_AfterUpdate()
If Me.NewRecord Then
      ProductName.DefaultValue = ProductName
End If
End Sub
 
If ProductName is a text field, then you must surround the value with quotes:
 
    ProductName.DefaultValue = Chr(34) & ProductName & Chr(34)
 
Best wishes,
Graham
[Access MVP 1996-2013]
 
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Khalid Tanweer
Sent: Monday, 25 November 2013 21:10
To: ms_access_professionals@yahoogroups.com
Subject: [MS_AccessPros] On form data entry desired fields input fills new row
 
 
John,
 
Hope you would be fine. Here i am with one situation to be resolved if there is any solution & i am rest assured you have in some of your pocket available for me.
 
On my form "Collection Voucher" I have a Combo box: ProductName, often a situation arises that for a specific "ClientCIN" he has say 100 cartons of same ProductName (with unique cartonNo and different weights).
 
So i need in this situation if i had selected any ProductName on first entry on the next rows it should fill with the same ProductName untill i need to change different ProductName, instead of selecting again and again from combo box or typing few alphabets to get the required ProductName 
 
Regards,
Khalid


__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar