Put the following code in a module and run showTableFieldTypes(). I only added 4 common data types in the daoDataTypeByNum function, but as you can see it's quite easy to expand :)
Sub showTableFieldTypes()
Dim tblTable As TableDef
Dim tblField As Field
For Each tblTable In...
Open a hidden form when the application opens.
In this hidden form:
- Set the Timer interval to 1000
- Set the On Open event to:
Private Sub Form_Open(Cancel As Integer)
booWordOpen = False
End Sub
- Set the On Timer event to:
Private Sub Form_Timer()
If FindWindow("OpusApp"...
This could be caused by some VBA code changing some of the values on your form. Since it only happens on the very first record, do you have any code in the form open or load events that changes values?
I wrote a new function that should work in your case. What you need to do is add "<data>" when the data starts and add "</data>" when the data end. Kinda XMLish :p.
Here's what happens:
1. All text gets read from the file
2. The code searches for <data> and then </data>
3. All text between...
You didn't specify on what event you'd like this new record to be created. If you do it on form load, as your post suggests, a new record would be created every single time the form gets opened..
Function yourFunction() As Boolean
Dim rstTable as DAO.recordset
Set rstTable = CurrentDB.OpenRecordset("SELECT * FROM yourTable WHERE FieldA=1 AND FieldB=2")
If rstTable.EOF Then
yourFunction = False 'no records
Else
yourFunction = True
Endif
End Function
The code goes in VBA in the OnClick event of a button. You can use it on as many textboxes as you like. E.g.:
Private Sub yourButton_Click()
txtBox1.Locked = False
txtBox2.Locked = False
txtBox3.Locked = False
End Sub
Or this code, which gives you a function like FindWindow except you can use wildcards in the caption which means you can just use the application title regardless of what form is opened.
Option Explicit
' Module Name: ModFindWindowLike
' (c) 2005 Wayne Phillips...
The code I posted skips all lines that do not have 4 fields that are delimited with a comma. This means that both the headers and the empty lines are skipped. Shouldn't it work in your particular situation, if you use option C?
E.g.:
SomeEmail.txt
Sender: blabla <- Skipped...
You can set the "Locked" property in the Data tab of the textbox' properties to lock the fields. Then you can unlock them using a button by adding code like the following:
txtYourTextBox.Locked = False
or if you want to use one button to both lock and unlock:
txtYourTextBox.Locked = Not...
The event passes on the ASCII code of the key that was pressed. You can use it to see if enter was pressed. The ascii code for Enter is 13, which you can also obtain by checking the ascii code of vbCr.
Example:
Private Sub txtYourTextBox_KeyPress(KeyAscii As Integer)
If KeyAscii =...
Alright, I think this should help:
Set Param = Cmd.CreateParameter("Payment", adDecimal, adParamInput, Payment)
Param.NumericScale = 3 'just guessing here
Param.Precision = 2
Cmd.Parameters.Append Param
This should work :). It skips the headers by checking if the line has 4 by comma delimited fields.
Private Sub Import_Click()
Dim objFilesystem As Object, objFile As Object
Dim strLine() As String
Dim rstTable As DAO.Recordset
Set rstTable = CurrentDb.OpenRecordset("SELECT *...
That is because the checkbox value is only null when no value has been specified. One of the many solutions to your current problem would be using:
varPaid = IIf(IsNull(Me!Paid), False, Me!Paid)
What do you mean with "What can I do when [ActdateComments] is null"? You can do anything you want! Do you mean you want to check if that value is null and if so, add a different value? The nz function does that for you. For example:
WordRange.InsertBefore...