Everything was fine in my DBase until I added one line of code:
Me.[jobnumber] = jobnumbervariab le
This assigns the text variable jobnumbervariab le to my Table's jobnumber text field. Now the dabase won't save the data after this field is updated!
Here's the whole code for this sub:
If Left(jobnumberv ariable, 3) = "ESC" Then
me.[jobnumber] = jobnumbervariab le
DoCmd.DoMenuIte m...
User Profile
Collapse
-
Stewart, that's a great idea, and I already had a date field to each record, so I already had the information needed to create the YYYY-0000 format for my ID numbers.
But, yes, I do have to reset the numbers each year back to 1. I had completely forgot about this issue! So what is the best way to use an incrementing Long Field as you stated.
Do I..
1: create a new table with an ID field - Table!NewID.ID... -
Better ID Numbers
I'm sure this has been posted many times, but I never had a need until now.
- I have a DB that tracks engineering jobs.
- Each JOB can have many TASKS.
- I need to track each TASK by a unique ID number in this format:
YYYY - JOB# - TASK#
Each Job number is sequential starting at 1 on January 1st.
Each Task number is sequential starting at 1 with each new JOB.
For example:... -
Yup, I just tried it, in every combo I could think of. I even created a separate query that joined two of the tables and then used it to link the third - no luck.
I still get duplicate entrees when one of the two linked tables has more than one entry. Hiding duplicates does nothing.
Example 2: three tables:
Maintable has two fields, ID and date
stafftable has two fields, ID and staff
hobbytable...Leave a comment:
-
simple report idea - but I can't figure it out!
I have three tables, all linked.
Table 1 "job" has an autonumber ID field.
Table 2 "tasks" has a [job] field that is linked to [job:ID]
Table 3 "staff" has a [job] field that also links to [job:ID]
The purpose is to track multiple tasks and multiple staff who are working on a single job. There can be a random number of tasks per JOB, and a random number of staff per [ID] - so I have... -
I guess that would work, as long as I code in some way to change that default setting every Jan 1, to match the new year.
Thanks!
PeterLeave a comment:
-
What is best way to create an autonumber that has a prefix?
Autonumber works great, but my boss needs the ID to be a number that begins with the 2 digit year. For example 08-465 and 08-466.
I know this must be a common requirement, so what is the best way to handle it? Should I simply create a new text field ([newID] and then use VB in a newrecord event that:
Me.newID = DatePart("YY", Now) & "-" & Me.ID
This works, but I want to see... -
need to add text at bottom of a DETAIL list in a report
OK, I’m new to all this, so forgive me if I missed some easy answer to this problem!
I have a report, which is actually going to be a letter. I had no problem adding my return address, salutation and top two paragraphs in the HEADER section. I also have no problem with the DETAIL section printing out the few records I need to show. But now I want to add a closing paragraph immediately after the DETAIL section. I tried to add it in... -
Thanks!
That is exactly what I did, but not with the nice error trap for non entries. Again, thanks for the help everyone! This is a VERY COOL forum!
PKLeave a comment:
-
Fish, thanks for the code. It works, but alas, I have the same table open on the form that I want to make changes to, so I get an error!
Arghg!
I guess there is no way to update the defaults on a table that is open and being accessed. I think I need to store the defauts in a separate table.
PKLeave a comment:
-
Each office gets their own copy of the database. The data is not shared or linked, it is for their own use. I could go in and show each office how to customize the table defaults to their specific office, or write up some instructions on how to do this, but I want to share this database with hundreds of offices around the world so that's not the best, user-friendly way to do it.
PKLeave a comment:
-
Changing a default value in a table
I am designing a database that will be used by many different offices, and each office may want to change the defaults I have in a table.
Rather than teach each user how to go in and change a table's default values, I want to create a user-friendly form that allows them to change the default values in the linked table.
Let's say I have a form field "office" on my form that is linked to the table field [department]...
No activity results to display
Show More
Leave a comment: