User Input Strips Commas
Feb 21, 2008
Hi,
I am trying to get it to display a prompt box that will display entries with a certain ID.
This query can be used to get the records with the IDs of 1 and 8:
SELECT * FROM table WHERE id IN(1,8);
Now this code can be used to get a record with an ID number that the user specifies:
SELECT * FROM table WHERE id=[Enter the ID Number];
So, I tried to combine the two together with this:
SELECT * FROM table WHERE id IN([Enter the ID Number]);
This however doesn't work because the prompt strips out punctuation - so if I type "1,8" in the box, it displays record 18.
Any ideas?
View Replies
ADVERTISEMENT
May 22, 2013
I am building a form in access and I am trying to find a way where user input isn't possible in the associated textbox when "No" from on option box is selected.
View 3 Replies
View Related
Apr 3, 2006
Hi,
I'm reasonably new to all this, and have read many posts and got most of my answers from reading the posts here! THANKS.
However I need some help with the following:
I have a form that allows someone to input information about products being booked in. However sometimes we have the same product from the same supplier with the same invoice number etc.. but they have individual serial numbers. So the scenario is I have ten items being booked in, they are all the same product from the same supplier but they have individual serial numbers. I have created a do while loop where I can duplicate all the information for each product, but I need it to pop up a box asking the user for the serial number each time it goes through the loop. He is what I have so far.
Dim MyQuantity As Integer
Dim TempSerial As String
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("BarcodesDB")
MyQuantity = 1
Do While MyQuantity <= Me.Quantity
'insert into table using either a recordset or Append Query
rs.AddNew
rs!Supplier = Me.Supplier.Value
rs!Date = Me.Date.Value
rs!Invoice_Number = Me.Invoice_Number.Value
rs!Pcode = Me.Pcode.Value
rs!Item = Me.Item.Value
rs!Quantity = 1
rs!Serial_Number = Me.Serial_Number.Value 'Get this value from user each loop
rs.Update
MyQuantity = MyQuantity + 1
Loop
rs.Close
Set rs = Nothing
Thanks in advance.
View 1 Replies
View Related
Mar 30, 2006
I want to prompt for user input that allows a "start date" and an "end date" in a report. Is this possible?
View 1 Replies
View Related
Oct 31, 2007
Hi,
Working on a query, what I have is a user will select a date on a form and hit submit.
I need the query that it runs, to pull all data -1 day from what they select.
So if they select 10/31 on the form, it needs to pull everything for 10/30 only.
I have this in my query now,
[Forms]![frm_change_report]![txt_Date]
Which pulls the data for the date they selected, but not sure how to subtract a day.
View 2 Replies
View Related
May 22, 2006
I am trying to make user input forms for each of the tables in my current database. I have made the forms, but I am required to have the forms come up blank first (so they can create a new record), but allow the user to edit existing records too. How do I do this?
View 3 Replies
View Related
Sep 9, 2006
Hello, all.
I have created a project in Access 2003 to track a student's progess toward a college degree. I want the user to enter their student id in a text box on a form, look up if that user is present in the student table, and if not show the form to enter their student information.
I can't get the text box to accept user input, and return the student info as a single record on the form. I have a query but I don't know how to set the proprerties to run the query.
Thanks for any help.
View 1 Replies
View Related
Oct 9, 2006
I want to put a textbox on a form that will take user input (a postal code) and put it into a table. I'm not sure how to do this. Is it even possible, and if so, any suggestions?
View 6 Replies
View Related
Oct 5, 2006
Last question.. honest.. maybe ;)
I have a query that prompts the user to display certain/all of the members in my member table. The problem is, using a parameter query in the memberID field only allows the user to send the message to one member, not multiple members. "1 or 2 or 3" or "1,3" obviously don't work.
I've tried creating a form with a list box to select the members (which I;ve done) but obviously you need code and stuff to get it to work which I think will be too complicated. Is there a simpiler way or is the form the only thing that will work?
Thanks
Kris
View 1 Replies
View Related
Dec 5, 2007
I seem to have run into a snag. I'm pretty sure this would work otherwise:
DLookup(iif(Left( [GenericFieldname1], 4) = "C101","Offered","NOT OFFERED"),"Generic Query")
When I added this field/function to the query, I got #error values and when I clicked on one, I got an error that said:
The expression you entered as a query parameter produced this error:The object doesn't contain the automation object 'Please Enter Year'.'
I assume the problem is that I have the user filter the report by use of the Like() function for [Year] in the query when the report is accessed. How do I tell the DLookup function to search the column as filtered by the Like() function?
View 1 Replies
View Related
Mar 14, 2008
i have a database that users log into before they can do anything, after they log in, when they open up a form, i want the username that was used to log in to be displayed and stored in a field. how would i do that?
Here are the relevant fields and tables
Name ---------------------- Description
USERS --------------------- contains username/password/success/date time for login
Login ---------------------- Login form
Username ------------------ Username field in 'Login'
Password ------------------ Password field in 'Login'
EXPOSURE_REPORT --------- Table that contains information for form VV
EXPOSURE_REPORT --------- Form
REPORTRECIEVEDBY -------- field that needs the current user stored in it
there are 6 or 7 users total, if that's at all relevant,
thanks!
View 1 Replies
View Related
Oct 9, 2006
I want to put a textbox on a form that will take user input (a zip code) and put it into a table. I'm not sure how to do this. Is it even possible, and if so, any suggestions?
View 2 Replies
View Related
Mar 10, 2013
I have a form, and on the form there is a Provider Rate which is a combo box, if the user select a zero rate, then it has the description please enter manual rate in box below. There is another box which the user can enter a manual rate.
how I can limit entry into these boxes, as currently a user can select a rate in the provider rate box and still enter something into the manual rate box. I want it so that if a rate other than zero has been selected in the provider rate box, then they can't enter anything into the manual rate cell.
View 9 Replies
View Related
Apr 17, 2013
I have two check box controls on a form, and I would like to set some sort of validation rule to make sure that one of the boxes is checked before the form is closed. I also have many other forms with text, radio, etc. controls that I would also like to set the same rule for.
View 4 Replies
View Related
Jul 29, 2014
I am working on a database that uses a form requiring personnel to log in. This information comes from a user table and is something that I have added on numerous occasions to various databases. The question I have is in relations to a "lockout." How do I set it up so that someone gets locked out after so many attempts loging in on this form?
View 8 Replies
View Related
Mar 15, 2007
Hi all.
Stumbled onto this forum during a google search.. looks like a great forum.
I have a question.
this thread http://www.access-programmers.co.uk/forums/showthread.php?t=124689
goes into a simple function to group by the name and add their total.. however what i need to do is that plus have a user input of the date.
eg of the table
Date Title Invoice
02/02/07 ABC123 11.00
02/02/07 ABC123 12.50
02/02/07 DEC123 11.50
03/02/07 ABC123 10.50
What i need is a paramater query to be able to work to give me the total of the groups..
Whenever i try to join my Parameter query with my sum query it gets messed up..
heres the code... what am i doing wrong?..
What i want displayed after they input the date is the group by and sum total of the parameter query..
SELECT RawData_tbl.[Title 2], RawData_tbl.[Estimated Value], RawData_tbl.[Date In], RawData_tbl.Quote, RawData_tbl.GST, Sum(RawData_tbl.Invoice) AS SumOfInvoice
FROM RawData_tbl
GROUP BY RawData_tbl.[Title 2], RawData_tbl.[Estimated Value], RawData_tbl.[Date In], RawData_tbl.Quote, RawData_tbl.GST
HAVING (((RawData_tbl.[Date In]) Between [Please Type the first day of the month] And [ Please insert the last day of the month]))
ORDER BY RawData_tbl.[Title 2];
View 5 Replies
View Related
Apr 10, 2008
Please could somebody point me in the right direction of code.
I have a database which I would like to query using a form with a combobox or two, each of which containing a list of eg. Customer Names, or Reference Numbers, which will then produce a report which can be printed out.
I know basic ADO, like get the database, open it, find records, update and delete records, however I have been unsuccesfully searching for the code to open a report, which will respond to certain sql parameters that correspond with the values in the combobox. And then be able to print that report if possible.
I would be much appreciative if anyone would point me in the right direction,
Thanks!!
View 2 Replies
View Related
Apr 14, 2008
Okay my access skills are low at best and I'm trying to build a database for work so hopefully this isn't to stupid of a question.
I'm trying to creat a query that will allow the user to type in a work type and have it generate the all records containing that work type. The way the data is in there to get it to generate just a specific work type without the input I have to use Like "*newacct*" for example. Is there any way to do this since there are more then one work types for some records?
Thank you
View 8 Replies
View Related
Feb 2, 2006
I have a form where a user will enter a 11 digit number (12345043456). Using ASP (VB) this string of numbers queries an access database and returns the entry for that specific number to the user.
Unfortunately, the numbers in the access table are an 11 digit number with hyphens seperating the string like this 12345-04-3456 (the ndc # of a pharmaceutical).
So What i need is some code that monitors and modifies the form input so that the hyphens are added in to the string when the user is inputting the data.
If i cannot do this, then is there some VB that I can add which modifies the field in the text file when it is imported into access on a daily basis.
Thanks
Terrons
View 7 Replies
View Related
Oct 9, 2006
I want to put a textbox on a form that will take user input (a zip code) and put it into a table. I'm not sure how to do this. Is it even possible, and if so, any suggestions?
View 3 Replies
View Related
Jan 27, 2006
How can I have a user enter the WHERE criteria in the Set Rs statement below.
Set Rs = CurrentDb.OpenRecordset("SELECT [Net] FROM [tblRecap] WHERE [Yr] = 2000 and [Event] = 'lancaster'")
I would like a message box to ask the user to define the [Yr] = and [Event] = fields since they would change from time to time and then pass the values to the OpenRecordset method. Is this possible? Can someone help supply the code?
A parameter query won’t work because when you manipulate these queries in DAO through VBA you need to supply the parameter value before you open the recordset object. If you don’t DAO generates an error.
Here is my code:
Option Compare Database
Option Explicit
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
Dim ConsqWin As Long
Dim ConsqLoss As Long
Dim tmpWin As Long
Dim tmpLoss As Long
Dim Rs As DAO.Recordset
Set Rs = CurrentDb.OpenRecordset("SELECT [Net] FROM [tblRecap] WHERE [Yr = 2000 and [Event] = 'lancaster'")
Do While Not Rs.EOF
Do While Rs!Net > 1
tmpWin = tmpWin + 1
Rs.MoveNext
If Rs.EOF Then Exit Do
Loop
If Rs.EOF Then Exit Do
If tmpWin > ConsqWin Then ConsqWin = tmpWin
tmpWin = 0
Rs.MoveNext
Loop
Set Rs = Nothing
End Sub
By the way the YR field is a number and not a date so the WHERE clause doesn’t need #2000#
Any help would be appreciated.
View 2 Replies
View Related
Feb 14, 2008
Greetings,
I have a form that contains an unbound listbox that is populated from a table. The user selects multiple records in the listbox and then clicks on a "Commit" button. The "Commit" button then copies portions of the records to another table. (And now that I am analyzing the flow of data, I realize that not all the data needs to be copied over, but I'll fix that at a later time).
Anyway, the code looks like this:
Code: Dim lst As Access.ListBox Dim rownum As Variant Dim vHEDR, vLeague, vFname, vMI, vLname, vClass, vQual, vSex, vYouth As String Dim intResponse As Integer Dim sqlstr As String Set lst = Me![lstHistorical] DoCmd.SetWarnings False For Each rownum In lst.ItemsSelected vHEDR = CStr(lst.Column(0, rownum)) & "," vLeague = "1," vFname = Chr(34) & lst.Column(1, rownum) & Chr(34) & "," vMI = Chr(34) & lst.Column(2, rownum) & Chr(34) & "," vLname = Chr(34) & lst.Column(3, rownum) & Chr(34) & "," vClass = CStr(lst.Column(4, rownum)) & "," vQual = CStr(lst.Column(6, rownum)) & "," vSex = Chr(34) & lst.Column(8, rownum) & Chr(34) & "," vYouth = Chr(34) & lst.Column(9, rownum) & Chr(34)'<<Here>> sqlstr = "INSERT INTO tbl_RosterTest (HEDR, LeagueID, Fname, MI, Lname, ClassID, QualID, Sex, Youth) VALUES (" & vHEDR & vLeague & vFname & vMI & vLname & vClass & vQual & vSex & vYouth & ")" DoCmd.RunSQL sqlstr Next rownum DoCmd.SetWarnings True MsgBox ("Persons successfully registered")
At the <<Here>> point, I would like to proc a single dialog box the query the user for some additional information - 2 items from comboboxes and one is a yes/no. Is there a way to gather the info so I can insert the values into the INSERT string?
Thanks.
View 8 Replies
View Related
Jan 10, 2013
Access 2007 DB. Is there a way to have an auto gen. email sent to me and or other admin. After user has completed input into form...
View 1 Replies
View Related
Jul 9, 2013
I am using Access 2002.I am going to be producing a macro that imports a txt file. Once the text file is imported there will be a empty field for a date value. Nothing in the file that is being imported will have a date in it.
I would like to (if possible) to, once the file is in the table, open an input box asking the user for a date (formated as YYYY-MM-DD) and once the date has been entered and the ok button pressed it inputs that date in to all records in the date field.
View 2 Replies
View Related
Nov 7, 2014
I have a form bound to a table, with a subform in there, and I have a textbox with a source one of the table's fields. I would like the value of this textbox to be calculated based on the values of some boxes in the subform, but I also wont to be able to edit the value on the textbox myself.
Is it possible to have a textbox that get its value both from calucaltions and user input?
View 1 Replies
View Related
Mar 2, 2014
I need saving 2 input fields into a table. Here is the situation
tableA
studentID
Name
tableB
studentID
Name
Course
Fee
I have a form with a drop down list, to select studentID from tableA. I selected a dropdown from studentID to display Name, and that I tied to txtName
I then type in txtCourse and txtFee whatever value I want, example:
txtCourse = English
txtFee = 50.00
Now, I'm able to transfer studentID and Name from tableA and save to tableB, and delete the record I just selected in tableA.
The issue is, I can't save the txtCourse, txtFee as I don't know how.
Here is what I have
Private Sub Insert_Click()
Dim strSQL As String
strSQL = "INSERT INTO tableB SELECT studentID, Name FROM tableA WHERE studentID = '" & txtstudentID & "'"
CurrentDb.Execute strSQL
strSQL = "DELETE FROM tableA WHERE studentID = '" & txtstudentID & "'"
CurrentDb.Execute strSQL
End Sub
I'm stuck on how to save txtCourse and txtFee into tableB where I have Course and Fee fields.
View 4 Replies
View Related