Generating A Service Number Using VBA
Aug 18, 2005
Hi,
I'm trying to make a database where a Date and a Service Number is entered into a form.
I have 2 buttons, one to automatically enter the Current Date and the second to automatically enter the Service Number.
The service number is incrimented by 1 each time and reset for every day.
eg.
Date Service Number
January 1, 2005 1
January 1, 2005 2
January 1, 2005 3
January 2, 2005 1
January 2, 2005 2
January 5, 2005 1
January 5, 2005 2
I already have the button that enters the Current Date. However, I am having trouble with the second button.
How can I code the button so that it searches the table for the Current Date and finds the record with the greatest service number for that date? After this is done, I want to create code that will automatically enter the next service number into the Service Number Textbox on the form.
eg. Using the Example Table Above
The date January 5, 2005 is entered into the Date Text Box and the Search Next Service Number button is pressed. The number '3' should show up in the Service Number Textbox
Sorry if its hard to understand, but thanks anyways.
I just realized that I placed this in the wrong forum, Sorry for the inconvenience.
View Replies
ADVERTISEMENT
Aug 5, 2013
I run a service related company and I am trying to develop a service database that will automatically calculate the next service due based on the previous service date, the catch is that the service need to happen on the same week day. i.e. if the last service was on Friday 02-08-2013 and it is a monthly service, the next service is due on Friday 06-09-2013. Is there any way that this can be done? PS there are various service periods such as bi-weekly, weekly, 2 weekly, monthly, 2 monthly etc.
View 2 Replies
View Related
Jan 15, 2007
I have a small .mdb for invoicing. Till now I had to put invoice number, which had two parts, manually for the first part, for example 001 or 002 and automatically for the second part as Date part. So I had, for example 2006 or 2007. The complete number was, for example 001/2006 etc.
The problem was New Year. Now, all previous invoices from 2006 have 2007 extension and the first parts are not starting form 001 but they continue.
View 10 Replies
View Related
Feb 8, 2008
First off, can it be done? I'm using Microsoft Access 2007, I'm wanting to generate an auto-number on the report. Basically I have an OrderTable, a PartTable, and a PackingListTable. I have a report that shows all orders ready to be shipped. But I need the shipping report to have a packing list number. I want this number to be auto-generated, and I was hoping I could do this when the report is opened. Right now the report is generated through a query of orders that are ready to be shipped. Yet I can't figure out how to put an auto-generated packing number on the report.
View 1 Replies
View Related
Jan 14, 2008
Hi guys,
I need some help here and any would be muchly apprieciated.
I am building a database for a theme park fast pass system where a customer can book themselves a place on a ride at three session times a day.
Now my problem is, that I need to generate a card number. 5555 1946 as the first 8 digits (this always stays the same) and then the last 8 digits is the customer ID number, which is in the same table. So there are 16 digits in total.
Let me give you an example:
A new customer registers and are assigned a customer ID of 1000 0001. Therefore the Card Number for that customer must be 5555 1946 1000 0001.
I have used auto number for customer ID so when a new customer signs up, there ID is 1 more that highest already in te database.
Simple question really...but how is this done?
A million marks for someone who breaks it! Hehe
Thanks
View 1 Replies
View Related
Dec 3, 2014
When I create a new record I am also generating a new Auto Number. This is so I have a sure fire way of returning the records that I want to return. I have read where it is a known issue that when using the Compact and Repair it can reset the Auto Number to a lower number and generate a duplicate Auto Number. That is the problem that I have at this time. I have tried using the Allen code but it doesn't seem to worked on linked tables. I use linked tables because I have multiple users who can access this system at any given point in time.how to have the Auto Number field select a number that is unique
View 12 Replies
View Related
Oct 11, 2013
I'm using the following code to generate a sequential number"
Code:
Private Sub Form_Load()
Me.txtReceivedDate = Now()
'assign an EmailID when form loads
Dim CurMax As Long
Dim NewMax As Long
'poll the current EmailIDs for the largest number from current year and add 1
[Code] ....
Until recently, I didn't have any criteria on the DMax and it worked perfectly. It's now been decided that the EmailID should reset back to 1 when the calendar year changes.*
*EmailID is not my primary key - There is a separate autonumber field used as the primary key.
The table I'm using the DMax on has a field named ReceivedDate which stores a Now() when a record is created. The form I'm working in has a textbox named txtReceivedDate that is set to Now() when the form loads as can be seen in the code above.
What I'm trying to use as my criteria in the DMax is to match the Year() of ReceivedDate in tblEmails to the Year() of txtReceivedDate on the form.
For 2013, the current max (CurMax) EmailID is 21. If I set my computers date back to 2012 (where the CurMax is 3) the txtEmailID is still being populated with 22, even though txtReceivedDate shows a 2012 date.
I've tried a handful of permutations of the criteria string:
Code:
Year([ReceivedDate]) & " = " & Year(Forms!frmNewEmail!txtReceivedDate)
Year([ReceivedDate]) & "=" & Year(Forms!frmNewEmail!txtReceivedDate)
Year([ReceivedDate]) = Year(Forms!frmNewEmail!txtReceivedDate)
I've tried a few others long the way that I don't even remember, but there's probably little value in listing all the ways that don't work.
I've got a syntax issue within the criteria since it's the first time I've tried to use one and it contains a couple moving parts.
Once I get this sorted out a follow on question is about dealing with the users changing the txtReceivedDate to a different year. As of now, I have the same code (everything except "Me.txtReceivedDate = Now()") also present in txtReceivedDate_LostFocus(), but I'm not sure that's the best place for it.
View 5 Replies
View Related
May 3, 2012
I am wondering if it is possible to calculate scores automatically based on the number of tick boxes the users have selected? If yes, how do I go about doing this feature?
View 5 Replies
View Related
Feb 28, 2008
A child in our company can have up to 4 different service providers offering different services at a time. I have to do a report for each individual service provider and there delivered services. The problem is, all the providers and delivered services are listed on one record (the child's record). How do I make a query that will only pull up their delivered services in a record and not the services of the others attached to it? Should I use IIF? If so, what would be a good statement to use? If anyone can help me out, I'd be thankful. Let me know if additional information is needed.
View 1 Replies
View Related
Oct 30, 2005
Hi All,
When I open a query in design view it can take anything upto 20 seconds to open. Tables are also slow to show, with a marked "slowness" over all. I tried the same database on an old laptop & the tasks were almost instant.
My main machine links to a file server, but the database files are not server based.
After much troubleshooting I have dicovered that it is the XP Workstation Service that is dragging it down. If I stop the service, then Access is rapid!
I have read all I can find on the subject, but nothing that helps. With all the parameters in the Workstation Service in the registry, is there a setting that I can change to speed things up?
System details:
XP Home (SP2)
Access 2002 (SP3)
Many thanks!
Dave
View 4 Replies
View Related
Dec 15, 2005
I'm trying to build a table structure for this database. Heres some background information about the business:
The business is a service business. We visit the customer's location and run tests on whatever water systems they have. Each customer is unique in that they could have any combination of systems at their site. They can also have more than one of the same type of system. The test results are the data that I need to record and store for future access. Each customer is visited on average once or twice a once a month. So there should not be more than 1-2 entries of data for each system for each customer per month.
For example
customer RUTGERS might have two systems labeled HWS and CHWS.
customer BMSQUIB might have three systems labeled HWS1, HWS2, and CHWS.
What I need to do with this information is go into the records of service visits, and retrieve for example, the last 4 visits of a specific system and prepare that information to be printed in a report along with their contact information.
I have come up with three tables to do this:
Customers Table contains:
Customer ID (pk), contact information data.
Systems Table contains:
System ID (pk), Customer ID, System Name
Service Records Table contains:
Record ID(pk), Date, System ID, Data
My thoughts were to have a table to contain customer information(each customer with a unique ID), a table to contain system information for each customer (each system has a unique ID), and a table to store the results of every service visit for each system(each individual visit has a unique ID)
Please critique this table design. If you think its sufficient, perhaps you could lead me in a direction pertaining to how to retrieve data on the most recent 4 visits (last 4 entries) for a specific SINGLE system from the Service Records table. I would assume that you would need to use a query and then get the data from that and put it into a form.
View 10 Replies
View Related
Feb 12, 2007
Hello,
I'm totally new to this forum. I have a database with the vehicle information in one table. The Vehicles' Odometer reading stored weekly in another table. I have the vehicles' service history with the Odometer reading of the last service in another table. The first two tables are linked by parent, child relationship. I now want to forecast the approximate vehicle service due date based on this information. All I want to do is extract the last 10 Odometer Readings from the Weekly Odometer Readings Table. Find the Average Kilometers with those 10 values. Come up with a figure. Determine the last value entered in the Weekly Odometer reading along with the date. Pull the last service history for the vehicle, with the odometer reading and date. Compare these 2 readings to see if the vehicle is due for service, and if so based on the average Kilometers run every week, determine the approximate date the vehicle is service for due. I badly need help on this one. So if someone could help me on this please let me know.
Thanks
View 3 Replies
View Related
May 7, 2013
Simply put, I have a front end that does a bunch of file moving and if it encounters an error and stops processing (which is intentional) I am the only that can login to the machine and fix it.
Is there any way to run it that would allow others to login on their own user profile, solution the problem, and start the processing again or am I stuck to a "per profile" instance?
I can't just let others login as me
View 2 Replies
View Related
Jan 16, 2015
I've been trying to solve this problem for the past month and at the verge of destroying my PC! I've trawled through numerous web sites but just cant seem to figure this one out.I'm trying to get access to tell me what the next service moth is based on the start date, end date, and the frequency of service.
For example:
Start date: 01/01/2014
End date: 31/12/2015
service frequency: Every 4 months
Using the above information the service months are:
1 - April 2014
2 - August 2014
3 - December 2014
4 - April 2015
5 - August 2015
6 - December 2015
View 6 Replies
View Related
Aug 28, 2005
WindowsNT 4.0 Service Pack 6 error in access runtime install
I have an access runtime install package that has worked numerous times
installing on XP Home. It was built using Office XP developer's packaging
wizard.
I tried installing it on a brand new PC running XP Home but it generates the
error:
Visual Basic 6.0 Setup Toolkit
The office system pack cannot be installed on this system because it
requires Windows NT 4.0 Service Pack 6 or later.
I cannot find any info on this - any ideas?
View 2 Replies
View Related
Dec 26, 2005
Hi
I use the Date and Time Picker. i know that i can get many other calendars, however, my theory is that i would rather use something that is directly supported by microsoft. but as i found out now that may not be the case.
on of my users updated his Office 2003 after he was having problems using my database (created on 2002 sp3). i know that the same database works on 2003 sp1. however, now microsoft is serving 2003 sp2. so after the update he he can't use the database.
so my questions:
1. how do i generally prevent users from getting update errors. i would like to atleast alert them with a meaningful message that their version of Office needs to be updated.
2. is this true that the Date and Time Picker doesn't work anymore? and if so, why isn't backwards compatible? and how do i prevent this from happening with other controls or scripts?
thanks,
sam
View 2 Replies
View Related
Mar 1, 2014
I have a client table.
I have a client product table for ski's
Each Client has 1 or more products (skis)
I have a Service Order table and form that I use a drop down control in the Service order to select the customer.In the Service Order Form a I have a continuous Subform for detailed service.
This is where I'm having the problem.In the detail subform I want to select from a drop down box the customers particular ski that I want to service. how to have only that one customers ski's to show up.
View 14 Replies
View Related
May 20, 2014
In a query I'm trying to return a list of rows sorted by Service Type Ascending and then the last item in the list should be a row called "Add Edit Value".If I 'ORDER BY 2' then the "Add/Edit" row appears at the top which is not what i want.
My SQL:
SELECT '' As ServiceTypeID, 'ADD/EDIT VALUES' As ServiceType FROM ServiceTypes UNION SELECT ServiceTypes.ServiceTypeID, ServiceTypes.ServiceType FROM ServiceTypes
ORDER BY 1 DESC;
View 5 Replies
View Related
Aug 22, 2014
How do I make quotes and invoices submittable with no product and service details? We use sale book tags and have a few tags that are voided. I want to keep them in our records as voided. I've create new quotes for these tags, labelled them as void through products and services, but I can not submit the quote. I think I can not submit the quotes because there is no Total Price amount. How do I submit quotes and then invoices for my records with no Total Price amounts?
View 2 Replies
View Related
May 5, 2005
hi,
I have a table that has results from races, eg.
Race No, Racer ID, Time taken.
i want to have a position field that will say which position the runner finished in. This is complecated as there are many different races.
At the moment the best thing ive been able to do is set up a query with a parameter on the race no. then the time taken is put in order and i have to manually put in the positions.
Manual is bad!
does any one have any idea about how i could make this automatic.
Thanx,
MAtt
View 1 Replies
View Related
Nov 2, 2004
So I've read a good 100 postings or so so far on the subject of how generating a unique identifier through any other means than an autonumber can be dangerous. But I can't resist the opportunity to simply ask if there is a way to make this possible, if only through a calculated field...
In my single user database, I have an employment table with an autonumber [EmploymentID] field as its primary key. The employment table exists in a one-to-many relationship with it's child, the income table where each form of income is recorded as it is recieved so that one form of employment (or employer) can produce many unique forms of income (like weekly paycheques).
I would like to be able to generate an identifier for the income table that is a combination of the parent [EmploymentID] field and an increasing number to produce something that looks like this:
1006789-001 -|
1006789-002 -|--> Same EmploymentID
1006789-003 -|
1006790-001 ----> New EmploymentID with a reset numeric
Any ideas?
~Chad
View 4 Replies
View Related
Jan 17, 2007
I have three fields, One called Key, one called IS and one called BC. I want the table to automatically copy the number from the IS field to the Key field to be used as the primary key. However, this field does not always have a value, when this occurs I want it to take the value from the BC field. Is this possible?
View 3 Replies
View Related
Nov 28, 2005
Hey yall,
Here's one to stump the band.
I must find a way to generate multiple records that consist of a ticket number as one field, and whether they have been used or not as another. The ticket numbers need to be sequential, with an increase in value of 1 over each previous record.
The ticket numbers will be seven digits long. Users, or their supervisors, must be able to generate a block of ticket numbers, by designating the first and last number, and thus they decide both the ticket number value range, and the number of ticket numbers to be generated at the time.
The difference between the first and last number might be a key to record generation, but then, can you use that to tell the system to add a specific number of records? And, other than appending pre-existing records,can you command the generation of records at all?
Thanks for any answers on this.
View 1 Replies
View Related
Jan 26, 2006
I am trying to copy a field multiple times based on a number in an unbound field on a form. As well attach a consecutive number base on the number enter in the unbound text box.
Like this
[Table1] . [Field 1]
A70-3886-01
A70-7003-01
copy this many times unbound text box on form in to 3
[table2] . [Field1]
Spool Number
A70-3886-01-01
A70-3886-01-02
A70-3886-01-03
A70-7003-01-01
A70-7003-01-02
A70-7003-01-03
View 6 Replies
View Related
Dec 30, 2004
I dont know what to call my problem but it's not much for experts, but too much for noobs like me. I've been trying to generate a random output in one of my forms which will get it's data from one of the tables that i made (Ex. frmForm1 will generate random data from Table1, and the fields are "Name", "Age", "Sex", etc.).. i've tried doing Randomize but it doesn't work. Pls advice, and thanks to whoever will give solution to this..
View 3 Replies
View Related
Jun 20, 2006
I need to generate a pre-formatted letter from within MS Access, where the name, address and other information will be pulled from the current record on an Access Form.
Basically it is like a welcome letter I could send to any new client I enter into the data base. Since I am doing one letter at the time, mail merge in MS Word is not an option
What would be the easiest way to do this?
Thanks
View 9 Replies
View Related