Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 15th, 2007, 04:12 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
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...
Reply With Quote
  #2 (permalink)  
Old June 18th, 2007, 08:34 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #3 (permalink)  
Old June 21st, 2007, 12:12 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
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...
Reply With Quote
  #4 (permalink)  
Old June 21st, 2007, 06:32 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #5 (permalink)  
Old June 22nd, 2007, 01:32 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
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...
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 05:31 PM
implementing auto run from usb flash drive arif_1947 VS.NET 2002/2003 0 October 6th, 2004 10:22 AM



All times are GMT -4. The time now is 02:58 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.