Hi,
As you have said it yourself, “I know for text boxes, there's a property: can shrink = yes”. Now the question is “How to use the textbox “Can Shrink” property to reduce empty space?
Let’s take an example…pseudo code.
Private Sub Report_Open(Cancel As Integer)
‘assume nothing in text box...
Hi Peter,
What is the option group name? Is it "FormStatus"?
What's the optStatus control for?
How is the part of the code activated from?
Select Case FormStatus
Case 1: >>>>> is this a typo?
Forms![frmLogHeader].Filter = "fk_LogState = 1"
Case 2
Forms![frmLogHeader].Filter = "fk_LogState =...
Hi Dave,
Try to update the Access service pack to version 3. Else, i don't know.
What i know about this, is that A2K has problems with the Help file. How to solve it? I really don't know.
If Help crash out on you, press ctrl-Alt-Del keys to bring up the task manager.
Go to the "Process" tab...
Hi Tom,
I hope you can see the mistake below, let's try one more time
For i = 0 To List0.ListIndex
If List0.Selected(i) Then
'mistake here
'strIN = strIN & List0.Column(0) & "," 'staff ID
'correction here
strIN = strIN & List0.Column(0,i) & "," 'staff ID
End If
Next i
strIN = Left(strIN...
Hi tom,
As long as the listbox name and rowsource is correct as in your case, your first column is “staff_id” there is no problem. As for the lisbox “Multi Select” property, why “Simple”? In your original post, you said about selecting multiple staff id’s records into tbincident with the...
It appears that there was no selection of staff_id. You need to make sure that the “for next loop” doe not exit else it will not work. Use the VBA editor, insert breakpoints to trace the errors. And make sure the listbox name is called “List0” or rename “List0” according to what you have named...
Hi Tom,
Seems much clearer now. Should have asked you about “tbincident” table usage and relationship.
By now you should be able to get the idea on how to insert records by listbox.
Here’s a sample for you to start with.
‘code in your command button
Dim strSQL as String
Dim strIN as String...
Hi Tom,
Not a good table design, as I don’t know how the workflow and the form design works, I can’t say much.
In the table “tbincident_log” the column/field “Staff” data type is “Text” or some alpha charactors?
For a start, lets try… in your command button… (warning air code here)
(List0 is...
Hi,
Any errors messages? Have you use the editor breakpoints to see what did your code went wrong?
First, in your VBA Editor, Tools – Options – In the Editor Tab, “Checked” all the frame “Code Setting” checkboxes.
Change this
Dim rst As New ADODB.Recordset, cn As String
To
Dim rst As New...
Hi,
Welcome to Access World.
Use a IIF(expression, true, false) in your SQL like...
Select Status, col2, col3.......IIF(Status =1, "Job complete", "Job not complete") as Expr1 FROM Table1
Bound text20 to the "Expr1".
Sorry, for not getting back to you soon.
You use the ListCount property in a For Next loop and use the Selected property to determine the boolean condition. Like….
Dim i As Long
Dim icount as Long
For i = 0 To ListView.ListCount - 1
If ListView.Selected(i) Then
icount = icount + 1...
Hi Dudley,
Yes, you're right. I notice there is a function where you set the background of a control and it is on the OnGotFocus, this might be the cause.
Hi Dudley,
Yes, that's right. I might be wrong, but I believe the problem lies at this subroutine "GetControlNameByTabOrder". This code is changing the control's Tab Index property. This is one area you should start looking at.