473,383 Members | 1,896 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,383 software developers and data experts.

Populate variable using SQL

Al
I want to populate a variable, MaxID, with the highest ID
in the PROJECT table. The ID field is an Integer. I want
to add 1 to MaxID, place a text prefix on it of "PM" and
insert it back into the PROJECT table in a PMID text field
(This will be used to link it to a Public Meeting record
in another table)

How do I populate the MaxID variable? (Access 2000)

TIA,
Al
Nov 20 '05 #1
3 3461
Al
Sorry, I meant to post this under access.formscoding.
My mistake...
-----Original Message-----
I want to populate a variable, MaxID, with the highest ID
in the PROJECT table. The ID field is an Integer. I want
to add 1 to MaxID, place a text prefix on it of "PM" and
insert it back into the PROJECT table in a PMID text field
(This will be used to link it to a Public Meeting record
in another table)

How do I populate the MaxID variable? (Access 2000)

TIA,
Al
.

Nov 20 '05 #2
"Al" <ak******@ci.tulsa.ok.us> schrieb:
I want to populate a variable, MaxID, with the highest ID
in the PROJECT table. The ID field is an Integer. I want
to add 1 to MaxID, place a text prefix on it of "PM" and
insert it back into the PROJECT table in a PMID text field
(This will be used to link it to a Public Meeting record
in another table)

How do I populate the MaxID variable? (Access 2000)


This is a VB.NET language group. Please turn to the ADO.NET newsgroup:

news://msnews.microsoft.com/microsof...amework.adonet

Web interface:

http://msdn.microsoft.com/newsgroups...amework.adonet

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3
Use cmd.ExecuteScalar with commandtext like
SELECT 'PM' + Convert(Varchar(MAX(ID) + 1))
"Al" <ak******@ci.tulsa.ok.us> wrote in message
news:20****************************@phx.gbl...
I want to populate a variable, MaxID, with the highest ID
in the PROJECT table. The ID field is an Integer. I want
to add 1 to MaxID, place a text prefix on it of "PM" and
insert it back into the PROJECT table in a PMID text field
(This will be used to link it to a Public Meeting record
in another table)

How do I populate the MaxID variable? (Access 2000)

TIA,
Al

Nov 20 '05 #4

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

Similar topics

3
by: Girish | last post by:
How do i populate a static hastable without the need to instantiate the class? any ideas? Im confused. class VAErrorMap { static Hasttable _ErrorMap = new Hashtable(); public VAErrorMap() {...
3
by: Yul | last post by:
Hi, We are in the process of designing an ASP.NET app, where a user will enter some 'Customer ID' to be queried in the database. If the ID is valid, several stored procedures will be called to...
2
by: gn | last post by:
I am able to populate a datagrid from an XML variable using the following: Try Dim ds As New DataSet ds.ReadXml(New StringReader(HttpContext.Current.Application("var").ToString))...
1
by: rn5a | last post by:
I was using a DataView to bind records from a DB table to a DataGrid using the following code: Dim sqlDapter As SqlDataAdapter Dim dSet As DataSet Dim dView As DataView sqlDapter = New...
11
by: eureka | last post by:
Hi All, I'm training in Servlets, JSP and JavaScript, I have a web page in which there's a "StudentName" textbox and below it is a "Names" Dropdown list. Initially the Textbox is empty and...
1
by: indhu | last post by:
Hi all, I want 2 know, how to populate using 2 combo box to populate other field. right now am using click event of combo to populate the other field but i want to select both combo1 and combo2 ...
3
by: stuie_norris | last post by:
Hi Readers, I wish to define a const structure and populate it with data. I have tried implement this in the example below, but keep on getting "Array initializers can only be used in a...
2
by: phenrol | last post by:
Hello, I am having issues getting my worker thread to function properly. I am working with visual c++ 6 and I am unsure that this is the correct forum to post in but I could not find another that...
3
daJunkCollector
by: daJunkCollector | last post by:
I have the html/javascript posted below, I imagine the fix to my problem is something simple that I am overlooking. My script is a little bit of html and javascript, and there is an embedded flash...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.