I'm working on a data-entry form and would like to restrict the data that I enter on certain fields to alphabetic characters only i.e. a -z, A - Z and Spaces.
Details: I have a Profile form that tracks the expiration date for each client's various certifications. These dates are set up in the Short Date format in the table design of Access.
Problem: When a user accidentally presses an alphabetic key while updating an expiration date, an Access error message is triggered. This is confusing to my users as these messages are written in Access lingo. I would rather that nothing occurs at all. I wrote a case statement to disable each letter of the alphabet and applied it to the On Key Down Event for each expiration date control on my Profile form to solve this problem, but this must be applied to 28 separate controls. I would rather call a function that disables alphabetic keys for each date control in my form when called.
Questions: How do I transform my Disable Alphabetic Keys Case Statement into a function that I can call for each expiration date control? I know that when writing a function certain variables have to be declared and/or initialized.
Also, will I need to create a function to re-enable alphabetic keys or is this unnecessary because the disable alpha keys function will only be called for specific controls, not the entire form?
What I Have Tried: I have tried copying and pasting my Disable Alphabetic Keys Case Statement into a module to attempt to create a function, but it needs work.
Below I have included 2 types of code: (1) The original On Key Down code applied to each date control on my form (2) The same code written as an attempt at a function
Original Profile Form Code to Disable Alphabetic Keys in the On Key Down event for each date control
Private Sub txtCert1ExpDate_KeyDown(KeyCode As Integer, Shift As Integer) Select Case KeyCode 'All message box text is for me to test the code, not for the user to see Case vbKeyA MsgBox ("you pressed the A key")
helloi have had alot of help on these forums already and i thank those that have helped me thus far.but i am having some troubles doing a query.i am trying to get a students grade.but each assesment they do has a differant weighting.for each assesment they are given a percent for it say 80% which may have a weighting of 30.while another assesment they have they get 52% but it has a weighting of 60.and if they missed an assesment it doesnt affect there grade.so what i am asking how can i get there percentage at the end of all the assesment and then turn that into a grade like B+.to better show you what i mean here is the end report i have to make which shows how subjects have weighting.http://i18.photobucket.com/albums/b145/hi2chriz/1stPage.jpghttp://i18.photobucket.com/albums/b145/hi2chriz/2ndpage.jpghope i was clear
Anyone know any issues that would stop me down grading an access 2007 database. Someone up converted it without me knowing but I want it to be usable for people on older versions.
I went to save as access 2003 and nothing happened. My initial thought was recompile the vba code and do a compact and repair. I did this and still nothing happens. I hit save as access 2003 and nothing happens no error messages or anything (HELPFUL).
I am having a problem coming up with a design for reporting by grades within a golf recording system. I want to calculate the grade for each player within a query, based on their handicap.
tPlayer contains the fields pName & pHandicap. tGrades currently contains gGradeName, gMaxHandicap.
In a query I want to be able to list by Grades Grades could be A , 10 B , 15 C , 27
or A , 10 B , 14 C , 19 D , 32 or whatever. but the number, name and ranges of Grades may change.
While it may seem odd, I want to be able to change the Grades and requery on the same Players data.
I feel it should be simple but have not been able to come up with either the design or SQL that would enable me to do this cleanly.
Hope this makes sense - any help would be appreciated.
I am creating an access database where the results to an exam will be entered (multiple choice exam so nothing fancy), and in turn they will be graded. I have searched and the closest thing I have come to this is the survey DB with a field for each question. However since this is a exam rather than having "no right answer" this answer needs to be compared with a key. So my question is as follows:
What table structure is ideal for this? ( I have yet to find a way to compare rows )
and my question is,how to calculate the student table's grade value? i want the result like below.. #studentID score Grade Sminth 88 A samantha 76 B Williamv 45 F martell 78 B
2 tables, tblStudentMarks and tblGrades 2 Queries qryResults and qryStudents_Grades
1.qryResults:Calculates the TotalAverageMaths+English+Science)/3. 2.qryStudents_Grades:Calculates the students grades based on the TotalAverage by comparing the total average to the min & max marks on the tblGrades.
Grades are compared within a range specified in tblGrades with the following SQL wich is the query qryStudents_Grades:
Code: SELECT SM.Student_ID, SM.Students, SM.TotalAverage, SM.Maths, SM.English, SM.Science, GD.Grade FROM qryResults AS SM INNER JOIN tblGrades AS GD ON (SM.TotalAverage>=GD.MinMarks) AND (SM.TotalAverage<=GD.MaxMarks);
Question: i would like to also calculate the grades of the individual subjects in the same query (qryStudents_Grades), where the marks got by a student in the subject..say maths is compared to the (tblGrades) and grade is displayed in a colum say maths_grades for each student.
How can i do this for all subjects in one query. (qryStudents_Grades)?
I have a query where on an IIF result a field is displayed or an "OK"
I have an imported field of 6 chrs where I only want the left 5 so I use Loc:=Left([Location],5) ,
I then compare the result in, MoveTo: to another fixed field [PreferLoc]
MoveTo: IIf([Loc]=[PreferLoc],"OK",[PreferLoc])
I wish to citeria out all the "OK" values so I have <>"OK" in the critria section but when I try to run the query I am presented with a selection box asking for Loc This Query feeds a report so I set the filter to yes in the report properties and use [MoveTo]<>"OK" as the filter and this works great until I close and reopen the app where the filter has gone ? Can anyone advise where I am going wrong with my query and or my report ?
I have a form with a "Keyword Search" This functions great. It applies a filter when I do the search. Which is what I want. But when I'm done, I want the filter removed. I can do this with a macro "ShowAllRecords". This works fine when I click on the command button it is applied to. The only thing is, it is no longer sorted by the "Auto" number field :( . I would like this to be done automatically when I remove the filter.
Is there any way to do this without clicking on my field, and then clicking on the "sort" button on the toolbar?
Thanks for any help.
:p Up to now, I've been able to find the answers to my questions by doing a search on this forum. So thanks to everyone who has been answering everyone's questions
Anyway for questions that state "check all that apply" I could either store in the Response Field a yes, or a no (or a number code for those answers) OR simply store the yes values for ones that are checked. Seems like the latter, but for querying later, will I run into problems? I have had different views based on reviewing posts.
I have a form where people can enter multiple records. In a command button on that form I have code that assigns a unique identifier for the record. Unfortunately I am getting an error and I think it is b/c the code is not running for each record. Is there a way to tell the code to run once for each record?
I am working on an ADP ( first time working with this ). I have a form that is based on a parametized query.
The record source for the form is the parametized query which works fine the first time it is brought up. When the user wants to change the client number, a button "change client" is clicked and the event that gets triggered is openform=("edit client")...... Well, instead of being prompted, I get the error "The ApplyFilter action contiains a filter name that cannot be applied".... When I do a right -click on that same button, and "remove filter "I can get my prompt, but I dont want to keep doing that. I am not sure how to remove the filter from this button. I am not sure what the error message is telling me. Thanks for your help.
I have created a runtime setup package for a friend to let her use my Access 2010 application, without having to purchase Access 2010. However, the ApplyFilter macro in one of the forms doesn't work in the runtime environment. The message suggested I use a SelectObject before ApplyFilter but that gave me another error.
How do I apply a filter that automatically loads when a form is opened? For example, I have a check box and I only want to load records where the box is checked.
I have a database that contains a table with all tasks made in our team and the time it takes to perform the task. I have another table with month, year and value in which I put month after month the volumes that each task handles. So, in a query I multiply the time to perform the task and the volume; month after month I have different results. However "the time to perform the task" may vary depending on processes improvements that we made. If before I had 5 minutes to perform the task and now I have 2, I change it and then the results on the query are changed for all months. I do not know if there is a way to specify that that change must be applied from the month where it is updated to the following months and not retroactively.
I have an issue trying to apply a filter to a record-set. Here's the code:
Dim choice As String Dim rset1, rset2 As DAO.Recordset Dim dbs as DAO.Database Dim var As Variant
[code]...
Whenever the last line is executed, i.e. rset2=rset1.OpenRecordset, I get the following error message:<<<Too few parameters, Expected 2>.. It used to work before? Maybe an issue with my library?
I have a DB with tables where the primary key fields are autoincremented, but with formatting applied.
Formatting is for example "CC"000000 so record 1 will be CC000001. (each table has a different alpha prefix)
This works fine, except the database content is being read by another application, and it sees only the 1, 2, 3 etc. Exporting the data to Excel format proves that this is due to Access not the other application.
However, if I export to Excel format, and tick the "Save Formatted" option, the data exported is as I require, CC000001, CC000002 etc.
Is there a setting or way to make Access present the data when it is read by another application to be the 'formatted' version of the data?
I have a continuos form (list of records) with a tool bar with "filter by form buton". This buton allow to users filter the list of records showed by the form by diferent field criterias.
After applied a filter I need a buton in the tool bar to print the filtered records on a report with a specific design: logo company, header, footer, etc.
I don't know how to apply the same filter used by the form to a report. Notice the filter by form continuos change depending the user.
I have not too much experiencie in programming. So I appreciate in advance any help.
Hi, OK my main form is unbound and I have a subform in it which is shown as a datasheet. What I'm trying to do is have a list box control at the top that allows the user to filter the records shown in the subform.
Q1. Do I need to have this set-up like this? Is it possible to just use one form? I have tried doing this but when I add my list box, lables etc to the top of the form or the header they just do not appear in datasheet view.
Q2. If I do need to use a subform how do I reference it when using DoCmd.ApplyFilter from my main form:
DoCmd.ApplyFilter , "DrawingNum = '32-35612'"
At the moment this gives an error saying that the action or method is invalid because the form is unbound.
I have a form with names, address, work completed on a certain date. etc. I have a bound textbox called "DATE" and a bound checkbox called "APPLY_DATE_TO_ALL". I wish to enter a date in a textbox called "DATE" then place a check in a checkbox called "APPLY_DATE_TO_ALL" and it applies this date to ALL records.
I have a text box that the user enters a number into between 1 and 5. I can use the validation rule in the table and that works nicely, the trouble is that I don't want the standard Access message box.how to apply the validation rules.
Hi. I have a table used for years. I added new fields bringing number to 160. When I go to insert another row, I get message saying 'Row inserted in the grid exceeds limit of 255 rows for table or 1,000 rows (actions) for a macro.'
BUT as the number of records had not increased and I am under the 255 limit why the error message?
I tried in vain to copy and compact/repair the database, but still no luck.