473,795 Members | 3,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I append a series of numbers from...to?

I have a table which holds certification numbers that come in batches. The
numbers will run from (for example) 456 to 496. I have to enter these
numbers individually. Is there a code I could use to append from 456 to 496
to the table? I'd like a pop up form that prompts for the number from and
the number to.
Aug 22 '06 #1
2 1321

Robert Waggoner wrote:
I have a table which holds certification numbers that come in batches. The
numbers will run from (for example) 456 to 496. I have to enter these
numbers individually. Is there a code I could use to append from 456 to 496
to the table? I'd like a pop up form that prompts for the number from and
the number to.
create an unbound form. put two textboxes on it. Format them as
numbers. (so you can't do something like assign a text value to one of
them). Then you need a button on your form to execute some code to do
this.

dim rs as dao.recordset
dim lngCurrentValue as Long

set rs =
dbEngine(0)(0). OpenRecordset(" TableRecordsGet AppendedTo",dbO penTable,dbAppe ndOnly)

'grab the start and stop values from your open form.
For lngCurrentValue = Me.txtStartValu e to Me.txtStopValue
rs.AddNew
rs.Fields("Your FieldName")= lngCurrentValue
'---set values for any other fields here if you need to
change their defaults
rs.Update
next lngCurrentValue

rs.close
set rs=nothing

Aug 22 '06 #2
okay, I actually tested this one...
I have a form, which is *not* bound to a table.
On it are
a textbox, "txtPersonI D", which is formatted as a Fixed number, 0
decimal places.
a series of checkboxes for some states. (This is a test - I only made
4, but that's not really relevant.)
I changed the .Tag property of each checkbox to the 2-letter
abbreviation for the state it represented. (Sorry, that's going to be
tedious)
Then I added a button with this code attached:
Private Sub Command8_Click( )

Dim rs As DAO.Recordset
Set rs = DBEngine(0)(0). OpenRecordset(" tblResidence", dbOpenTable,
dbAppendOnly)

Dim ctl As Control

For Each ctl In Me.Controls
If TypeOf ctl Is CheckBox Then
If ctl = True Then
rs.AddNew
rs.Fields("Pers onID") = Val(Me.txtPerso nID)
rs.Fields("Stat e") = ctl.Tag
rs.Update
End If
End If
Next ctl

rs.Close
Set rs = Nothing

End Sub

Aug 22 '06 #3

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

Similar topics

2
3310
by: Christopher M. Pieper | last post by:
I want to generate a resultset that is just a series of numbers in ascending order or perhaps a series of dates.. What I mean is, is there a way to generate a temporary table of dates given an input of a start date and an end date.. This table would then contain an entry for each date in ascending order from the start date to and including the end date.. Or perhaps with numbers, given a start of 5 and and end of 7 the resulting table...
25
7652
by: Yves Glodt | last post by:
Hello, if I do this: for row in sqlsth: ________pkcolumns.append(row.strip()) ________etc without a prior:
4
4868
by: YS Sze | last post by:
If you know the exact longitude and latitude for a specific location, would anyone think it'd make any sense to find out if this set of location numbers is really part of the Fibonacci series or not? Or, another way to look at this is that: Would anyone of you think it is worth a while to find out if there is any location on earth with the set of longitude and latitude numbers that coincides with the Fibonacci series? As I see it, if...
47
4574
by: shan | last post by:
Hi to every body, I am a begginer in C.can anybody give the complete code for fibinocci series (0 1 1 2 3 5 8 ...)an input is get from user to calculate how many numbers to be printed.I am using turbo c++. thank U in advance
9
3103
by: falcon | last post by:
Is there a way I can do time series calculation, such as a moving average in list comprehension syntax? I'm new to python but it looks like list comprehension's 'head' can only work at a value at a time. I also tried using the reduce function and passed in my list and another function which calculates a moving average outside the list comp. ... but I'm not clear how to do it. Any ideas? Thanks.
26
10145
by: John Salerno | last post by:
If I want to create a list of the form (where each item is repeated twice after the first one), how might I do that most efficiently? Right now I have this: series = for x in range(10): # just for testing series.append(series - 1)
4
3012
by: geoffp | last post by:
I need to generate reproducible random number series. I've done the obvious - use mt_srand with the same seed. This supposedly will create the same series every time. Is this true? Its not working for me. By the way, seeding mt_srand with different integers doesn't necessarily produce different series. I've done a little testing and every pair of consecutive even and odd numbers produces the same series. eg. seed 0 and 1
8
10974
by: srinpraveen | last post by:
I know to write a program to print the fibonacci series. But the problem is my teacher has asked us to write a program to print the natural numbers that are not involved in the fibonacci series. For example if the user gives 7 terms of the series to be displayed, then the display of the fibonacci series is 0, 1,1, 2, 3, 5, 8. But the natural numbers not involved are 4, 6 and 7. That's what my teacher wants. But I am struggling to write a...
3
3172
by: nujcharee | last post by:
Hi I have a series of queries, I have a number of temp tables which I use as templates for my data. I start with 1. Delete the data in a temp table 2. Use append query to fill the temp table with data Now, in the temp table, I have a memo field. I append information from a text column (Oracle DB) into the memofield in the temp table. For some reason, only the first 255 characters copied across as if it
0
9672
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
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
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
10164
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,...
1
7538
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
6780
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
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.