You also need to consider how your subform is going to "know" it's on the last record. Below is the syntax for what you need.
Private Sub Field1_KeyDown(KeyCode As Integer, Shift As Integer) 'assumes your control is named Field1
If KeyCode = vbKeyTab Then
'do something
End If
End Sub
Re: Defaulting a "Medium Time" field to be "p.m." instead of "a.m."?
Put the following in a standard module:
Public Function checkTime(strInput As String) As Date
Dim intHour As Integer
If InStr(1, strInput, "AM") > 0 Then
checkTime = Format(CDate(strInput), "hh:mm")
Else
intHour =...
What are you trying to accomplish with this exactly? Are you running data verification on the fields with your subroutines. If you want your users to be able to opt out by clicking off field with the mouse then why have the functionality in the first place? Rather than figure out how to...
You might need to work with a sub report in your detail section. Primary report group by address, no columns in page setup, sub-report (inserted in the primary report's detail section), group by address but dont show the group header and 3 columns in your page setup. You will probably have to...
Technically yes, it does go against normalization but, in your case it seems you are working with already existing data and need to restructure it for a specific use. If you are designing a database from scratch, with considerations as to how best to store data and subsequently manipulate it...
Make a new empty table with four fields: ID (long), NAME (Text), ADDRESS1 (Text), ADDRESS2 (Text) and put the following Subroutine in a module. Run the Subroutine and it will pull all of your data from the first table into the new one
Public Sub makeNewTable()
Dim rstOriginal As...
Happens to me more often than I would like. Only way to prevent code loss is to compile and save frequently and when you have a module completed, export it so you can reimport it into a new database if you are forced to start over.
On another note, for your future reference, creating and deleting temp tables leads to some serious database bloat even in a short time period. I have resolved a similar problem myself by declaring a user defined type in VBA to hold the record's data and perform operations with the data before...
Thanks for your generosity - this definately sounds worthy for inclusion in my resources bag for future use. Can you send me the Office 2000 versions at c_smithwick@cox.net And also to charles.smithwick@navy.mil
Found a typo. Change
Set objDataSet1 = objDataSets.ImportData(zDataSoure, , geoCountryDefault, , geoImportFirstRowIsHeadings)
to
Set objDataSet1 = objDataSets.ImportData(strDataSource, , geoCountryDefault, , geoImportFirstRowIsHeadings)"
Sub ImportExcel()
Dim strSpreadsheet As String
Const strImportDir As String = "C:\Import\"
strSpreadsheet = Dir(strImportDir & "*.xls") ' Will return the name of the first spreadsheet file in the directory
DoCmd.TransferSpreadsheet acImport, 8, "Table MAIN"...
Try a variant of the following:
Sub mapData()
Dim objApp As New MapPoint.Application
Dim objDataSets As MapPoint.DataSets
Dim objDataSet1 As MapPoint.DataSet
Dim objDataMap1 As MapPoint.DataMap
Dim strDataSource As String
Dim lColorRange As Long
objApp.Visible =...
'The following assumes two tables:
'#1 "tblMonthData" with three fields
' Customer (type long integer)
' DateFld (type Date/Time) should not name this field 'Date' as that is an Access reserved word
' Qty (type long integer)
'#2 "tblWeekData" with five fields
' Customer (type integer)...
To run at databse startup, create a macro named "autoexec". You will have one action in your macro - "RunCode" and the function line will be
ListFilesToTable("C:\Data", , True)
To run this from a form, in the "OnClick" event of whatever button you want to push, add the line...
You can't do it from Access, but you can do it from Outlook. Put the following in the "ThisOutlook Session" module of the Outlook Inbox you will be monitoring:
Option Explicit
Public db As DAO.Database 'Must have Microsoft DAO 3.6 Object Library referenced
Public WithEvents outItems As...
Make sure you have the following added to your references:
"Microsoft Visual Basic for Application Extensibility 5.3", "Microsoft Scripting Runtime" and "Microsoft Access 11.0 Object Library"
Insert the following in a module and run the function "ProjectDocumentor" from a macro. This will create a table containing all of your forms, their controls and functions associated with events on the forms as well as which modules the functions are in. It will document each function in your...
Welcome!
In my experience, there are a great deal of employed IT "professionals" out there who can have some pretty dodgy actual experience. Don't feel intimidated by your "newness" - you can excel in your career if you study and learn to solve things without too much reliance on the "old...