473,398 Members | 2,380 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,398 software developers and data experts.

Single Click Transfer Of Record Between Tables

I have a front end form that lets a user put in their information (name, phone #,etc) and when they submit the form it gives them a queue number. At this point this information is recorded in it's own table. I have then set up a form that would allow me to approve them to the actual queue. Essentially I could look at a record and approve it by clicking a button and have the information cut from the first table (Student_Signup) and recorded (pasted) into the actual queue table (3d_Queue). I tried using an onclick event to follow a snippet like this but am having trouble having it work:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command43_Click()
  2.  
  3. Set db = CurrentDb
  4. Set rec = db.OpenRecordset("Student_signup")
  5. Set rec2 = db.OpenRecordset("3d_Queue")
  6.  
  7. You can then check, add and edit data using the proper calls
  8. i.e.
  9.  
  10. rec2.addnew
  11. rec2("ID") = "Done"
  12. rec2.update 
  13.  
  14. End Sub
Obviously I'm new to this and trying to teach myself so anything would help.
Nov 27 '10 #1
1 1349
Here is some basic air code you can customize to accomplish your task.
Expand|Select|Wrap|Line Numbers
  1. 'NOTE: The following code requires a reference to "Microsoft DAO Object Library"
  2.  
  3. Dim strSQL As String
  4. Dim daoDBS As DAO.database
  5. Dim daoREC As DAO.Recordset
  6.  
  7. Set daoDBS = CodeDb
  8. strSQL = "SELECT ColumnA, ColumnB, ColumnC, FROM TableA WHERE Recordset = MySearchCriteria"
  9. Set daoREC = daoDBS.OpenRecordset(strSQL)
  10. If Not (daoREC.BOF And daoREC.EOF) Then
  11.     daoREC.MoveFirst
  12.     While Not daoREC.EOF
  13.         If daoREC("ColumnA").Value = "Whatever I am looking for" Then
  14.             strSQL = _
  15.                 "INSERT INTO TableB (ColumnA, ColumnB, ColumnC) VALUES(" & vbCrLf & _
  16.                     adoREC("ColumnA").Value & "," & vbCrLf & _
  17.                     adoREC("ColumnB").Value & "," & vbCrLf & _
  18.                     adoREC("ColumnC").Value & ")"
  19.             CodeDb.Execute strSQL, dbSeeChanges
  20.             CodeDb.Execute "DELETE TableA.* FROM TableA WHERE Recordset = MySearchCriteria", dbSeeChanges
  21.         End If
  22.         daoREC.MoveNext
  23.     Wend
  24. End If
  25.  
  26. daoREC.Close
  27. daoDBS.Close
  28.  
  29. strSQL = ""
  30. Set daoREC = Nothing
  31. Set daoDBS = Nothing
  32.  
Nov 28 '10 #2

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

Similar topics

0
by: Jeff Louie | last post by:
I am running into a problem using the OpenFileDialog box when single click is enabled. I am running WinXPP SP2, Visual Studio 2003, Windows Forms. I am getting a lot of null exceptions in an...
1
by: Sakharam Phapale | last post by:
Hi All, How to capture Mouse Single click and mouse double click event on Commnad Button. I am doing as follows. Private void Button1_MouseUp(Object sender,...
3
by: Siv | last post by:
Hi, I have a ListView control in a Windows application, currently single clicking a customer name in this list, selects the customer and displays their details in text boxes to the right of the...
3
by: Peter Darley | last post by:
Folks, I have a couple of databases that should really be schemas in the same database. I tried to find suggestions on how to easily move all the tables/sequences/etc. from the public schema in a...
0
by: jim | last post by:
Hi, I have a TreeView control that sits on the MasterPage. All of my other webpages inherit from that Master Page. The Treeview receives it's data using an XMLDataSource that has it's DataFile...
1
by: csubillr | last post by:
I have some files on my site that I want several family members to be able to view (photos) and then download. I have a page setup that gives them thumbnails (64x48) and allows them to view the...
2
by: vinodkus | last post by:
Dear Sir/madam Please tell me how to refresh an asp page in a single click of a button. Thanks in Advance
0
by: akshay b | last post by:
Hi, I am creating a custom form designer. In this I am taking a windows form at runtime on which I am droping controls like label, textbox etc. But I am not able to drag these controls anywhere...
4
by: vineetbindal | last post by:
Hi all, I have a gridview, when onselectedindexchanged in fired. i want to convert the selected row's column's into dropdown so that user can select the new value and update it. please tell me...
8
by: starrysky | last post by:
I have a program which puts an icon in the notification area and has a menu associated with it available by right clicking on the icon. I want the menu items to be selected by single left clicks but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.