473,652 Members | 3,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sending from form back to a table and than printing

27 New Member
I have part of my form done, called frmcustomers with drop down menus which are working fine, thanks to prior help on here. Now I have an issue, I want to be able to send my information selected in my checkboxes back to a new table with everything checked, I don't want it to go back in the table I already use to get the information from the check boxes. I have a cmd print button, and I want to use that to first, use the information selected send back to my new table and than print that set of information out, I have a couple of fields that will go in the table, client, test, time, date. If anyone can help, much appreciation.

Justin
Mar 16 '07 #1
8 1390
MMcCarthy
14,534 Recognized Expert Moderator MVP
Hi Justin

Sorry I'm not sure what you are trying to do. Do you want to add a record to another table based on the current selections in the form?

Mary
Mar 17 '07 #2
chembuff1982
27 New Member
Yes, from my checkbox selections which are already displayed on the form through a table and selectable I want to hit the print button which I have printing fine already, but before it prints, I want someway to send the selections on the drop down to a new table called login. I have time and date set up, customer name set up and customer test. Any help would be appreciated thanks for the response Mary. I have the empty table, I just need to know how to take my information from the checkboxes and date, and send them to each field in this table, for Customer, test, date, etc. One simple example would be fine, I've tried to search all over the net, and my access book is useless. I use to program years ago, I'm so rusty now it's not even funny. I do mostly lab work and secretarial. I'll send a donation in when I complete the project, because this site is so helpful to me and I'm thankful for that.
Mar 19 '07 #3
chembuff1982
27 New Member
Can anyone help?
Mar 20 '07 #4
MMcCarthy
14,534 Recognized Expert Moderator MVP
Can anyone help?
Would something like this work?
Expand|Select|Wrap|Line Numbers
  1. Dim strSQL As String
  2.  
  3.    strSQL = "INSERT INTO Login (Customer, test, date) " & _
  4.        "VALUES('" & Me!Customer & "', '" &  Me!test & "', #" & _
  5.        Me!date & "#)"
  6.    DoCmd.RunSQL strSQL
  7.  
This assumes Customer and test are text fields and have the same textbox names on the form as column names in the table.

Mary
Mar 22 '07 #5
chembuff1982
27 New Member
Here's my code
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdprint_Click()
  2. On Error GoTo Err_cmdprint_Click
  3. Dim stDocName As String
  4.     Dim MyForm As Form
  5.  
  6.     stDocName = "tbldate"
  7.     Set MyForm = Screen.ActiveForm
  8.     DoCmd.SelectObject acTable, stDocName, True
  9.     DoCmd.PrintOut
  10.     DoCmd.SelectObject acForm, MyForm.Name, False
  11.     Text54.Value = Now()
  12.     Text54.Visible = True
  13.  
  14.     Exit_cmdprint_Click:
  15.     Exit Sub
  16.  
  17. Err_cmdprint_Click:
  18.     MsgBox Err.Description
  19.     Resume Exit_cmdprint_Click
  20. End Sub
  21.  
  22. Private Sub Combo27_AfterUpdate()
  23. Dim rs As Object
  24. Set rs = Me.Recordset.Clone
  25.     rs.FindFirst "[CompanyID] = " & Str(Nz(Me![Combo27], 0))
  26.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
  27.     Me.Combo29.Requery
  28.    Combo29.Visible = True
  29.  
  30. End Sub
  31.  
  32. Private Sub Combo27_Change()
  33.   cmdprint.Visible = False
  34.  
  35. Dim strCustomer As String ' define string
  36.  
  37.         strCustomer = strCustomer & "" & Me.Combo27.SelText & ", "
  38. 'appending the value to string from box
  39.  
  40.     ' remove excess off string in append
  41.     strCustomer = Left(strCustomer, Len(strCustomer) - 2)
  42.  
  43. MsgBox strCustomer
  44. End Sub
  45.  
  46. Private Sub Combo29_AfterUpdate()
  47.  cmdprint.Visible = True
  48.  
  49. End Sub
  50.  
  51. Private Sub Combo29_Change()
  52. Dim strTest As String ' define string Test to use for append
  53.  
  54.         strTest = strTest & "" & Me.Combo29.SelText & ", " 'append string from combobox
  55.  
  56. ' to remove excess comma stored in append
  57.     strTest = Left(strTest, Len(strTest) - 2)
  58.     cmdprint.Visible = True
  59. End Sub
  60.  
  61. Private Sub Form_Load()
  62.   Text54.Visible = False
  63.   Combo29.Visible = False
  64.   cmdprint.Visible = False
  65.  
  66. End Sub
  67.  

I want those strings from Combo27 (to go into TablePrint in field CustomerPrint), and Combo29( to go into TablePrint in field TestPrint).
Mar 22 '07 #6
MMcCarthy
14,534 Recognized Expert Moderator MVP

I want those strings from Combo27 (to go into TablePrint in field CustomerPrint), and Combo29( to go into TablePrint in field TestPrint).
Are these new records to be appended or are you trying to update existing records?
Mar 25 '07 #7
chembuff1982
27 New Member
Are these new records to be appended or are you trying to update existing records?

They are new records I'm storing them, taking them originally from a table, and upon selection, through the drop down boxes, sending the submitted results to a new table to store the selections. Just pretty much for record keeping of clients and tests that go on.
Mar 26 '07 #8
MMcCarthy
14,534 Recognized Expert Moderator MVP
They are new records I'm storing them, taking them originally from a table, and upon selection, through the drop down boxes, sending the submitted results to a new table to store the selections. Just pretty much for record keeping of clients and tests that go on.
The problem is that the two values are being retrieved in two separate procedures. You need to consider the following.

Storing the values in public variables for use later.

Creating a Add to table button which will retrieve the values from the two combo boxes and insert them into the table.
Expand|Select|Wrap|Line Numbers
  1. Dim strSQL As String
  2.  
  3.    strSQL = "INSERT INTO TablePrint (CustomerPrint, TestPrint) " & _
  4.        "VALUES('" & Me!Combo27 & "', '" & Me!Combo29 & "')"
  5.    DoCmd.RunSQL strSQL
  6.  
Mary
Mar 26 '07 #9

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

Similar topics

4
4438
by: Nomen Nescio | last post by:
can anyone be so kind as to look at http://www.mysolution.ws/HYPOCRITE.php and let me know why it isn't passing the form data to http://www.mysolution.ws/insertHYPOCRITES.php for the most part, the scripts were created with http://phpcodegenie.sourceforge.net/
5
2622
by: BaWork | last post by:
I have a web form where a client can select which site members to send an email to. This form is populated from the contents of the member table, so the form can have 0-x names listed on it depending on member expiration dates. When the form is submitted, the code loops through the form contents and sends an email to those members that meet the selected criteria. All this worked perfectly when I was sending text emails, but since I
2
2081
by: Del | last post by:
I have two question on sending email messages from MS Access (Versio 2000, 2002, and 2003). I have a form with a command button to send an email message, the code behide the button is as follows; ============================================================================= Dim strRecipient As String Dim strSubject As String Dim strMessageBody As String
1
2085
by: bidllc | last post by:
I'm working on a minor bug from an open source bug tracking system (bugtracket.net). It's a great app, but I don't want to bother the creator any more than I have to, so I thought I'd pose the question here. The problem is with an email that gets sent from the system. In a nutshell, it's an HTML format email that is choking on the string that is returned form this function that is added to the email's body:
8
1960
by: Philippe Lang | last post by:
Hello, I need to send emails from Postgresql triggers. I was able to do it with a 'plperlu' function, that calls the 'system' perl function, that itself calls the 'mail' shell function. Is is safe to do things like this? Is there a possible concurrent access that could arise?
13
3901
by: salad | last post by:
Hi Guys: I was stuck. I needed to send a report to a file. My beautiful report(s) in Access were going to require loss of formatting with RTFs, a PITA in WordMailMerge, sending it as a text file...whatever. I described my situation to the guy I'm doing work for and he did some research for me and came up with the following link. http://www.novapdf.com/ The part that should excite us Access developers is their SDK
6
2237
by: Barry Edmund Wright | last post by:
Hi, We are having a large cheque run printed by an outside printer. The printer asked us to give him the layout of the fields to print on a form and send it to him. As an example the form looks like this: xxxxxxxxxxxxxxxxxx dd mm yyyy xxxxxxxxxxxxxxxxxxxxxxx zzzzzzzzz.99
7
3331
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of guests added. form.php function createGuestNameAndEmailElements() {
8
2908
by: nargis2009 | last post by:
Hi, I have been encountering problems with my web page which is supposed to send email, and wondered if anybody can help find error. Initially I had all codes in one page and on click of Submit it would send email. But then I wanted to give a user an opportunity to go back and edit the entries if incorrect before submitting. I separted the codes into two pages. On the second page when Submit button is clicked it should send email. But...
0
8367
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
8279
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
8811
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8703
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
8467
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,...
0
8589
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
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
5619
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();...

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.