Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 15th, 2007, 04:12 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default Auto run quit not cleat

Hi guys,

         I want to set u a field to generate auto bill number..
 like..## IND/25/07 ### ..I dont know how to start with..

 please give me an solution ..



Learn as you can..
------------------------
pap...
 
Old June 18th, 2007, 08:34 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

It sounds like you are building a string from elements on the form. If this is the case, on the form's Before Insert event, add the code to build the string and put it into the Bill Number text box (should not be editable.)

Did that help? If not, where are you getting these elements:

IND
25
07?

Sounds like a day and year, and some other element.



mmcdonal
 
Old June 21st, 2007, 12:12 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default

mc,

 like an billing software ,generate bill number automatically ..i want to generate gatepass number automatically ..

 did you got the idea..

 please revert me .!


Learn as you can..
------------------------
pap...
 
Old June 21st, 2007, 06:32 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I know exactly what you want to do. The issue is, where are you getting the elements?

I see that of "IND/25/07", 25 and 07 probably come from the current date. Where does the IND come from? Without knowing that, here is some code:

On the Before Insert event of the form:
(Assuming field [IND] and field [BillNumber])
(Assuming field [BillNumber] is locked and disabled)

Dim sBillNo As String
Dim sIND As String

If IsNull(Me.IND) Or Me.IND = "" Then
   MsgBox "Please enter that field value."
   Exit Sub
Else
   sIND = Me.IND
End If

sBillNo = sIND & "/" & DatePart("d", Date) & "/" & DatePart("m", Date)

If IsNull(Me.BillNumber) Or Me.BillNumber = "" Then
   Me.BillNumber = sBillNo
Else
   MsgBox "There is already a Bill Number for this record."
End If

This will automatically create the Bill Number. However, there may be some issues with when the user sees it.

Did that help any? Do a search of Microsoft for "regular expressions".


mmcdonal
 
Old June 22nd, 2007, 01:32 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default

ind is an example value its not in the database..

ok i ill explain in detail ..

the text box name txt_passno
the Gatepass no. is like ARIS/01/05/07

 in this ARIS is an constant text come for every gate pass number and 01 is the gate pass number and 05 is the month and 07 is the year ok . Each time when iam adding the record for gate pass the ARIS will be remains same the gatepass number should increases and the month and year should change according to the system month and year...

did u got the idea what i really need ..

thanks a lot for ur attention .

anukagni

Learn as you can..
------------------------
pap...





Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto run when loading a spreadsheet alantodd Excel VBA 5 June 27th, 2009 02:59 AM
Help: Disable the "Shift Key" on macro Auto run ofAlexander Word VBA 1 June 24th, 2007 03:16 AM
Auto Run Program echovue Visual Basic 2005 Basics 0 February 13th, 2006 06:31 PM
implementing auto run from usb flash drive arif_1947 VS.NET 2002/2003 0 October 6th, 2004 10:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.