The Question Of Too Many Codes?
Apr 25, 2007
I have been wanting to ask this question for long. Is it alright to put too many codes in the various events of the forms and controls? Will it affect the efficient functioning of Access? Will those codes result in any absurd behaviour? For example, I have DMax function in the BeforeInsert of form followed by three If....End If codes. I have not faced any problem so far. However, I just want to hear the opinion of the experts.
View Replies
ADVERTISEMENT
Jun 5, 2006
I have a table that contains a Zip Code field. Some of the Zip Codes are missing the leading 0. Zip Codes are a 5 digit field and these codes only have four. how do I get Access to recognize the number of characters and then add the leading 0 to only the ones that have 4 numbers?
Thanks
View 1 Replies
View Related
Jan 18, 2007
Has anyone had any dealings with a way to calculate distance between 2 zipcodes? Of course all the zips wouls be in the current DB.... Then need to query those within a certian distance of another zipcode. I have a feeling this will need to be linked to an external source or app........ BUT... Anybody have any experience with anything similiar?
View 5 Replies
View Related
Apr 9, 2007
I would like to print a bar code on my invoices and then have my delivery drivers run the invoice under a bar code reader when they return from delivering. I know how to print the bar code I am nit sure how to go about interfacing a bar code reader in access 2000. Any thoughts?
View 3 Replies
View Related
Jul 25, 2005
Hi i have designed a database where the users use a combo box to find a particular code they want..for example dog_brown or dog_grey, on the report which i have produced this code for the type of dog shows up to. I have another table which has a column with the code and also the description...eg dog_brown...brown dog. My users have asked me if on the report which i have produced can the description be shown instead of the code. I dont know if this can be done...any help would be grateful. Thanx
View 3 Replies
View Related
Oct 21, 2005
I was wondering where I might get a list of code I can use to change text in my program. If there is no list what would I use to get dark green. Right now I am using the following:
[description of failure].ForeColor = vbGreen
Thank you
roborro
View 2 Replies
View Related
Jun 27, 2007
Hi, I have the following problem.
I have three tables, Main Table, Table A and Table B. All three tables have a field called "Cutoff Time". The Main Table will look up the info from Tables A and B. Table A has a field called "Service". In the main table, there is also a field called "Service", which is same as the field in Table A. The condition is this: The main table should use the "Service" field to match the "Service" field in Table A to get the "Cutoff Time" from Table A. If there is no such match, then the "Cutoff Time" will be taken from Table B using another field called "Station".
I was wondering, how can I perform such an operation? Do I need to write SQL statements?
Thanks in advance!
View 1 Replies
View Related
Feb 23, 2006
I would like the textbox named "text7" to show the word "keswick" when the text inside the "txtUsername" is KH and show the word "Lawrence" when the text inside the "txtUsername" is LH. What sort of codes should I write? should it be SQL or Expression Builder or Code Builder? Thank you=)
View 2 Replies
View Related
May 11, 2006
Sometimes the simplest of questions can be the hardest to find the answer to. I have spent the last 2 hours searching for the answer to this one. I'm sure it's on this site somewhere but the search is running way to slow for me to be of any use.
What exactly does the numeric color codes in VBA represent? I have downloaded a score of color pickers. utilities and none use these numbers in the way Access does. Ideally, I'd like to find a utility that will allow me to specify a particular color and then give me the corresponding code for that color.
TIA
View 2 Replies
View Related
Jan 23, 2008
Does anyone out there have any ideas on how I can get a full list of the error codes and their descriptions for microsoft access?
I've set up a simple table with two fields, one for the error code and the other for the description. I've written a short bit of code (see below) to build the table for me, but it only generates 88 codes with the highest being 746.
Now I know that there are error codes up in the 3000 area because I'm trapping a few of them.
What I'm looking for is a list of the error code so I may write an extended list in my error trapping routines.
Code as follows:
Private Sub Form_Load()
Dim My_RecordSet As DAO.Recordset, My_DataBase As DAO.Database
Dim My_Error As Long
Dim My_Description As String
For My_Error = 0 To 4000
On Error Resume Next
Err.Raise My_Error
My_Description = Err.Description
If My_Description <> "" Then
If My_Description <> "Application-defined or object-defined error" Then
Set My_DataBase = CurrentDb
Set My_RecordSet = My_DataBase.OpenRecordset("ErrorCode_Table", dbOpenDynaset, dbAppendOnly)
With My_RecordSet
.AddNew
![ErrorCodes] = My_Error 'set error #
![ErrorString] = My_Description 'set error description
.Update
.Close
End With
End If
End If
Next My_Error
End Sub
Cheers muckers
D
View 3 Replies
View Related
May 23, 2005
I am working on a membership database that only has members from Canada and the United States. In the zipcode field, is it better to have two seaparate fields or is there an input mask that can handle both US and Canadian zip codes.
Thanks in advance.
24t42
View 2 Replies
View Related
Jan 17, 2006
Hello,
I was wondering, is there a way to comment out some of your SQL codes in Access querries, like you do in Oracle or SQL Server or VB?
I need to know how to write comments in my SQL codes when usingh access
View 2 Replies
View Related
Jan 17, 2005
I have a list of codes:
K101
K101A
K101B
K101C
K101D
K101E
L101
L101A
L101B
L101C
L101D
I want a query that displays all codes that dont have a letter on the right.
View 3 Replies
View Related
Feb 25, 2014
I have a report bound to a query that includes zip codes as a field. Zip codes are formatted in the table as 99999-9999 and display in this format when the query is run. However, when I place that field in the report text box as
=[ContactCity] & ", " & [StateAbbreviation] & " " & [ContactZip]
or even as [ContactZip]
The zip is not formatted.
View 1 Replies
View Related
Mar 28, 2012
I am using Access 2010. I have 4 columns in my file. They are "Code", "Item", "Qty", and "Amount" . I have 5 products with my own codes. It means the codes are set by me. For example, 00001 for ruler, 00101 for book, 00201 for pencil, 00301 for rubber, 00401 for pen. My wish is to link the code and product together. It means that when I sell a pen, I must type the code for pen (in the "code column") and I must type pen in "Item Column", so I think it really takes long to do this because I will really make a mistake because the code and item are not linked at all. What I mean is that when I fill or know the code, I will get the product automatically in the "Item Column" or vice versa.
Now I have set the code 00401 for pen.
So when I need to fill the information. I wish to fill the code in the "Code Column" and then the word pen is automatically shown in the "Item Column". In this case, I will be able to get right code linked to its product.
View 1 Replies
View Related
Jan 1, 2006
I have a problem about running SQL statement in VBA code. I will appreciate a looot if you can help me solve the problem ASAP.
I tried to run the following statement in my VBA code to update a table in my database:
DoCmd.RunSQL "UPDATE TBL_GRANTBASEDATA, TBL_QUARTER SET TBL_GRANTBASEDATA.Retire_QTR = TBL_QUARTER!QUARTER WHERE ((([TBL_GRANTBASEDATA]![Retire_Date])<=[TBL_QUARTER]![End_Date] And ([TBL_GRANTBASEDATA]![Retire_Date])>=[TBL_QUARTER]![Start_Date]));"
It turns out that the table will not be updated if I run the above SQL statement with my other VBA codes. (ACCESS doesn't give any error messages even though the database was not updated.) But if I run the SQL statement by itself rather than within the other codes, the database will be updated successfully. (When I set a breakpoint at the above SQL statement and run it manually within the other codes, the database are updated successfully too.)
Apparently, the SQL statement and the other codes don't have any syntax errors. I wonder why ACCESS doesn't execute the SQL statement when the SQL statement is put within the other VBA codes. Is it because the table it tried to manipulate was locked by the other codes?
The following are all the VBA codes including the SQL statement I'm talking about. When I run the following codes together, the database is not modified by the SQL statement (the last sentence). But if I run the last sentence and the other codes separately, the database was modified successfully.
Dim rstDataLoad As New ADODB.Recordset
With rstDataLoad
Set .ActiveConnection = cnnSHELL
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Source = "SELECT TBL_GRANTBASEDATA.* FROM TBL_GRANTBASEDATA;"
.Open
End With
'Calculate Retire_Date
rstDataLoad.MoveFirst
Do While Not rstDataLoad.EOF
Calculation omitted.
rstDataLoad.MoveNext
Loop
rstDataLoad.UpdateBatch
rstDataLoad.Close
Set rstDataLoad = Nothing
DoCmd.RunSQL "UPDATE TBL_GRANTBASEDATA, TBL_QUARTER SET TBL_GRANTBASEDATA.Retire_QTR = TBL_QUARTER!QUARTER WHERE ((([TBL_GRANTBASEDATA]![Retire_Date])<=[TBL_QUARTER]![End_Date] And ([TBL_GRANTBASEDATA]![Retire_Date])>=[TBL_QUARTER]![Start_Date]));"
View 4 Replies
View Related
Aug 30, 2006
I have a query Im working on in the query are several fields. 2 fields (cat1 and cat 2) have nothing but 3 digit category codes (ex- 333, 334, 335 in the and some null values. Another field is the quantity of items I have which must be >0.
I have 7 codes I want to delete from cat1 and cat2 so my guess is I would place Not "333" And "334" And "335" in criteria for mcat 1. I also need to do the same for cat2. So I would apply the same criteria in the same row under cat2. So heres how my query would look in design view.
cat1 | cat2 | quantity
Not "333" And "334" And "335"| Not "333" And "334" And "335"| > "0"
Its not working, I can only seem to do one "Not" in all of the fields. So If I do Not "333" in cat1 I wont be able to do anything in cat 2 nor will I be able to add 334 to cat 1 or 2. I have tried Or it doesnt work I have tried using different colums and different rows.
There has to be a way to delete the same criteria from 2 different fields for multiple items per the same field.
Any thoughts? Much appreciated!
View 1 Replies
View Related
Nov 21, 2005
I have a Contacts DB and at the moment I enter Cities/Towns and Post (zip) codes separately. I now want to set it up so I can select a city or town and have the appropriate post code fill it's own field without my intervention. Is this a case of cascading combo's or can I just bind a post code field to the city/town field? Can someone point me in the direction I need to go please?
View 1 Replies
View Related
Sep 8, 2014
I have to create codes with a certain algorithm.
It consists of 6 digits (positions) and looks for example like this: 6D45F3
On each position the sequence is "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", so it has 16 possibilities.
Beginning from the last position going up to the first position the positions change according to the above sequence and starts from "0" when it has reached "F".
In the example above the next codes would be
6D45F4
6D45F5
...
6D45FF
6D4500
6D4501
...
6D450F
6D4510
...
So after each 15th loop the next positions changes and the previosu set back to "0". I thought that this should be easy but I failed with this code.
var16Stelle = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F") '16 Elemente
strErsterBC = UCase(InputBox("Enter the first code.", "Barcode-Generator")) 'for example 6D45F3
intRow = InputBox("Entere the number of codes to create.", "Barcode-Generator")
intStart6 = ListIndex(Mid(strErsterBC, 6, 1), var16Stelle)
intStart5 = ListIndex(Mid(strErsterBC, 5, 1), var16Stelle)
[Code] .....
View 2 Replies
View Related
Oct 14, 2013
I have a query that will sort groups of zip codes using the following expression: Between [T_ZipRange]![StartZip] And [T_ZipRange]![EndZip]. The first and last zip codes are entered and the expression returns the zip codes between the "start" and "end" range. The problem is that if a zip code is only 5 digits: xxxxx- instead of xxxxx-xxxxx, the zip code will show up in other sorts. The zip code field is a text field. How can I limit the sort, based on the number of digits in the zip code?
View 2 Replies
View Related
Jun 19, 2006
Hi all,
I've got this simple thing.. which I couldn't do and stuck for a long long time.. I have done some programming in a few languages, but not in SQL or VBA and I quite confused about programming styles that VBA and SQL accepts.
I'm currently working in Microsoft access and the thing I'm stuck on is retriving field value from a record and writing into another record on the same table.
For example the table "Table-users" looks like the following:
ID Name Year Month Date
1 Steven 1979 9 18
2 Jeremy 1977 10 22
3 Eslynn 1988 10 10
I've built a form that contains two lables (combobox), "ReplaceMe" "LoadMe" and a command button. Which end user could choose which record to load and which to replace.
I wish to copy Year, Month and Date from LoadMe into ReplaceMe without effecting the Replace me ID and Name.
The VBA, SQL code i've got looks like.
-----------------
'Command_Click is the tigger button to active the following code.
Private Sub Command37_Click()
'Below is an example of what I wanted to do field by field. However, in the real
'environment, I needed to move about 20 odd field into another object. I'm not sure
'to use Append or Update Query
Dim UpdateSQL As String
Dim text1 As String
Dim text2 As String
Dim text3 As String
'this loads the string containt-the Name of the object-into text1.
'this line works fine, arr.. other ones don't.......
text1 = Me!ReplaceMe
text2 = Me!LoadMe
'Load the month of the LoadMe.
text3 = Table![Table-users = text2].month
'Loads the SQL instruction into UpdateSQL
'Table-table is a table, containing several objects and fields.
UpdateSQL = "INSERT INTO [Table-users].text1( [Day], [year], [month] ) " & _
"SELECT Table-users.Day, Table-users.year, Table-users.month" & _
"FROM Table-users" & _
"WHERE (((Table-users.Name)='ReplaceMe'));"
DoCmd.RunSQL UpdateSQL
End Sub--------------------
Well the obvious, the above code doesn't run.
If LoadMe = Jeremy, ReplaceMe = Steven, the above code should return:
ID Name Year Month Date
1 Steven 1977 10 22
2 Jeremy 1977 10 22
Making Steve's Year, Month and Date field the same as jeremy
======================
What I think i'm confused about is when do I use [ ] ( ) ! .
Like... if I wanted to read the field value of "Date" from the object from the "Name" in combo box "LoadMe", what should I write?
ie, if the combo box "LoadMe" contains Eslynn. The end result should be 22.
Many thanks
View 2 Replies
View Related
Jul 5, 2012
I run an after-school youth program for high school students. My issue is an accurate way to track attendance of students. We have MS ACCESS 2010 on our computers at work.
On any given day we may see between 30 to 50 students, so this is a small operation - - and the reason I'm adverse to buying fancy "custom" software and hardware "systems". Because students come and go and vary over time, we may see 100 kids in a given week, but in the past 2 years of operation, we have had well over 250 students come through our program, with some returning at various times.
What I would like is to be able to
1) Make a simple ID card with student photos and a unique ID # that can be ...
2) Scanned by a simple barcode system.
2b) Actually two barcode swipes ... one swipe at the front door / main entrance, and a 2nd swipe by a hand held bar code in the various four classrooms to be sure the student is not only in the building, but also went to the correct class.
3) That the input of that information dumps into our ACCESS database so we can track student attendance, and ...
3b) provide reports out to school counselors / principals of the numerous highs schools that our students come from, to let them know which of their kids are actively attending our program.
My questions are ...
A. Can this be done with ACCESS?
B. Would it be better to do this with EXCEL?
C. If ACCESS can handle it, which types of bar code devices would be the best choice for us to purchase? (We would need a total of five barcode scanners. One at the front desk, and one in each of our four classrooms.)
The system would need to be expandable seeing that this could easily be doubled in terms of classrooms and students within the next year or so. We are currently just 2 years old.
View 3 Replies
View Related
Nov 7, 2013
I have a database where several entries may have the same address, but someone has been inputting some of the zip codes incorrectly. I want to come up with a way to get a query or the like to spit out a report with just the entries that have identical addresses and conflicting zip codes, and have hit a brick wall.
View 5 Replies
View Related
Sep 12, 2007
Hi
I have set up a form to run a query with the criteria linked to the options/drop down menus on the form. I am able to search for criteria set out in the combo boxes. However, what i would like to ensure is that if the drop down boxes are left blank the results will be to show 'all' results for that field.
help is greatly appreciated!
thanks in Advance!
Shapman
View 3 Replies
View Related
Jun 21, 2012
I wish to designate unique customer codes in my database during data entry.
For example;
Liz Stimp = LS1
Liz Stamp = LS2
Lyne Small = LS3
Lipo Suction = LS4
I have successfully linked the first and surname using a "Left 1st letter" in the expression but I do not understand how to add a 'unique' number to the code to give me the result I am after.
Expression so far is .....Left([First Name],1)+Left([Surname],1)
View 9 Replies
View Related