473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Displaying a Number entered in a previous record on a new record

2
Hello,

I woudl like to dispaly the order number which has been entered into a previous record on a new record.

I am unable to use an autonumber as our Order number format is constantly changing with the date.

Thanks.
Aug 20 '07 #1
5 1251
Stang02GT
1,208 Expert 1GB
Hello,

I woudl like to dispaly the order number which has been entered into a previous record on a new record.

I am unable to use an autonumber as our Order number format is constantly changing with the date.

Thanks.

Hello Aboone and welcome to TSDN!!

If i am understanding your question correctly you want to have the same order number for multiple records? I am assuming that your order number is based off of the date?

You could create a form that allows you to enter your own order numbers. This way when you are going through if the order numbers are all going to be the same for that day you can enter them in or there might be a way to code something like that in VB, although im not sure.

But let us know a little more about what you are doing that way myself or someone else will be able to assist you better :)

Good Luck!
Aug 20 '07 #2
missinglinq
3,532 Expert 2GB
To assign a value from a the last record entered into the next (new) record entered you have to use the control's AfterUpdate event. The exact syntax depends on the datatype of the particular field.

For Text fields
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourTextControlName_AfterUpdate()
  2. If Not IsNull(Me.YourTextControlName.Value) Then
  3.   YourTextControlName.DefaultValue = """" & Me.YourTextControlName.Value & """"
  4. End If
  5. End Sub
For Numeric fields
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourNumericControlName_AfterUpdate()
  2. If Not IsNull(Me.YourNumericControlName.Value) Then
  3.   YourNumericControlName.DefaultValue = Me.YourNumericControlName.Value
  4. End If
  5. End Sub
  6.  
For Date fields
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourDateControlName_AfterUpdate()
  2. If Not IsNull(Me.YourDateControlName.Value) Then
  3.   YourDateControlName.DefaultValue ="#" &  Me.YourDateControlName & "#"
  4. End If
  5. End Sub
  6.  
Welcome to TheScripts!

Linq ;0)>
Aug 20 '07 #3
Stang02GT
1,208 Expert 1GB
To assign a value from a the last record entered into the next (new) record entered you have to use the control's AfterUpdate event. The exact syntax depends on the datatype of the particular field.

For Text fields
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourTextControlName_AfterUpdate()
  2. If Not IsNull(Me.YourTextControlName.Value) Then
  3.   YourTextControlName.DefaultValue = """" & Me.YourTextControlName.Value & """"
  4. End If
  5. End Sub
For Numeric fields
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourNumericControlName_AfterUpdate()
  2. If Not IsNull(Me.YourNumericControlName.Value) Then
  3.   YourNumericControlName.DefaultValue = Me.YourNumericControlName.Value
  4. End If
  5. End Sub
  6.  
For Date fields
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourDateControlName_AfterUpdate()
  2. If Not IsNull(Me.YourDateControlName.Value) Then
  3.   YourDateControlName.DefaultValue ="#" &  Me.YourDateControlName & "#"
  4. End If
  5. End Sub
  6.  
Welcome to TheScripts!

Linq ;0)>

Linq,

Does this code work off of whatever Aboone enters? So if the 1st order id Aboone enters 1234 it will be the same for all the records until that number is changed?
Aug 20 '07 #4
Aboone
2
Hi Everyone,
Thanks so much for the help, but I am afraid I wasn't quite clear enough.

I will be entering a new order number for each record. I would simply like to be able to see the order number f(rom the last record entered) on the new record.

I hope that is a little clearer. Thank you again for your help!
Aug 21 '07 #5
you could just set a text field = to a Dlookup of the last number
Aug 21 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mark ??;-\) | last post by:
I would like to display a listing of files on a web page as follows: If there is only one file: display the section name and then display the current file. If there is more than one file (for...
3
by: Robin S. | last post by:
I tried to ask this question several days ago, but I didn't explain my application correctly. Basically I want to have one record from table "A" and I want to display, say, 5 records from table...
9
by: MLH | last post by:
I have a database (datatrek.mdb) with a table named DATA. The table has a date/time field with default value = Now(). It has 100 records in it entered over a 50-minute period. I would like the...
0
by: Scott269 | last post by:
So I've got an old MS Works database I imported into Access. I needed a primary key so I created a record number field that was just the record number I manually inserted when I entered it in the...
1
by: Scott269 | last post by:
So I've got an old MS Works database I imported into Access. I needed a primary key so I created a record number field that was just the record number I manually inserted when I entered it in the...
2
by: Mike N. | last post by:
Hello- I have a database that uses an auto number field type that goes out of sync periodically. My customer gets a "cannot add record, number already in use" error message. I dump the records...
2
by: Robert | last post by:
I have a label on my form lblCount and the following code in my form for displaying a record count: Private Sub Form_Current() Me.RecordsetClone.Bookmark = Me.Bookmark Me!lblCount.Caption =...
0
by: hbomb | last post by:
I have a form which is used to both enter data for an application and to view a snapshot of previous data entered for students. The database’s initial point of entry is a form called INTERESTED...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.