473,779 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File Name Increment.....0 001.tif, 0002.tif

Here is a something I used recently to increment job numbers for a
company. Create counter table with one integer filed (i.e.
tblCounter). Create a single record with the starting value (in you
case 001). Then, all you have to do is use the Dmax function to grab
the last value and after that value is used, apply code to insert a
record creating the next available number. Here is the code:

Private Sub Combo23_AfterUp date()
Dim intLastType3 As Integer
Dim intLastType2 As Integer
Dim dtYear2 As Variant
Dim dtYear3 As Variant
Dim strType2 As String
Dim strType3 As String

intLastType2 = (DMax("SiteCoun ter", "tblCounterType 1"))
intLastType3 = (DMax("Material Counter", "tblCounterType 3"))
dtYear2 = Format(Now, "YY")
dtYear3 = Format(Now, "YY")

Select Case Me.Combo23.Text
Case "Furnish & Install Track Builder"
DoCmd.OpenForm "frmAssignJobNu m_TrackBuilder"
Case "Furnish & Install Site Specific"
strType2 = intLastType2 & "-" & dtYear2
Me.txtJobNumber = strType2
Dim Db As Database, rs As Recordset
Set Db = CurrentDb()
Set rs = Db.openrecordse t("tblCounterTy pe1")
rs.AddNew
rs!SiteCounter = intLastType2 + 1
rs.Update
rs.Close
MsgBox "The new Job# has been recorded", vbInformation, "Tech-con
Job Log"
Case "Furnish (Material Only)"
strType3 = "$$" & intLastType3 & "-" & dtYear3
Me.txtJobNumber = strType3
Set Db = CurrentDb()
Set rs = Db.openrecordse t("tblCounterTy pe3")
rs.AddNew
rs!MaterialCoun ter = intLastType3 + 1
rs.Update
rs.Close
MsgBox "The new Job# has been recorded", vbInformation, "Tech-con
Job Log"

End Select
End Sub

HTH

Jason

pa********@hotm ail.com (PaulMac) wrote in message news:<1e******* *************** ****@posting.go ogle.com>...
Thanks Rick,

Could you please post the Dir() code that you use.

thanks,
Paul

Nov 12 '05 #1
0 1743

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
3782
by: Kevin Knorpp | last post by:
Hello. I need to be able to extract the data from the attached file (or any file in the same format) so that I can work with the data in PHP. I'm fairly comfortable with using PHP with databases, arrays, etc. but have not worked with binary data files. http://www.performancecentral.net/C...3Loop/3Loop.php click on "Download Performance".
0
357
by: Jason Smith | last post by:
Here is a something I used recently to increment job numbers for a company. Create counter table with one integer filed (i.e. tblCounter). Create a single record with the starting value (in you case 001). Then, all you have to do is use the Dmax function to grab the last value and after that value is used, apply code to insert a record creating the next available number. Here is the code: Private Sub Combo23_AfterUpdate() Dim...
1
1208
by: linda.h.jackson | last post by:
Hi, I have a field in a table that needs to be automatically incremented but the number is non-standard. There is already existing data in the table but for future records, I need a certain number and it's increment to appear. Original data: Pkg_Id=1111.0001, 1111.0002, etc. New data: Pkg_Id=2008.1000 Any record added after Pkg_ID=2008.1000 needs to look like the
2
2369
by: jkflens | last post by:
Hello, i convert one XML-document by using XSLT into another XML-document. First change all attributes to elements is no problem. Then i try to insert a new element into the new document by XSLT, but it doesn't work correctly :-( Example:
2
3104
by: Antonio-F100 | last post by:
Hello, I need help creating the code for a macro button on a form that will open a file directory with windows explorer. I have about 500 directories with very long names and only want to input part of the directory name into the table that the form uses.
1
2625
Cyberdyne
by: Cyberdyne | last post by:
Hi Guys I am working on a database that will have a locked auto field with the following characteristics. It has to be a number that will be stored in a table, it needs to have the following format 00-0000 , in the actual table it will start with 06-0001 that being 06 is the year then - 0001 being the first case, from then on it will be 06-0002, 06-0003, 06-0004 and so on when next year hits I want the 06 to change to 07-0001 and so on. The...
2
2318
by: zmann1976 | last post by:
Hi all this is my first post and I’m sorry I’m a noob. I’ve been working on this for a couple of days and I cant seem to get it. I’m very sure that this is probably a very simple problem but it eludes me. I need to do this in python on a Linux box. Here is the sequence of events. Open a tcpdump file named something like “webdump.txt”, here is a sample of that file 11:30:07.830643 00:b0:64:19:86:f0 > 01:00:0c:cc:cc:cc snap ui/C...
6
3790
by: luanhoxung | last post by:
hi all ! I have a text field with contruction: 0001-COM. I need to it automatically increase 0002-COM when add new record and ..... Any help with appreciated. Luan
1
2189
by: Chithra Anoop | last post by:
I want to create files with different names in c#. It should be in the form 0001.9001 0001.9002 0001.9003 0001.9004 0001.9005 0002.9001 0002.9002 0002.9003 0002.9004 0002.9005
0
9636
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9930
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.