I thought they were unbound. My mistake.
The form I was referring to has all unbound text boxes. I used an ADODB recordset to return values to pass to various functions that do the calculations. These functions then return values to be assigned to the unbound text boxes. If I used this code in...
Dim db as new access.application
set db = CreateObject("Access.Application")
db.OpenCurrentDatabase pathname
db.DoCmd.OpenForm formname, acNormal, , , acFormEdit, acWindowNormal
db.Visible = True
I know you asked for psuedo code but I happened to have the code right in front of me. Remember...
I had the same problem just yesterday. Put the code in the Report_Activate() event. Make sure there is nothing attached to the on_open event otherwise anything that is assigned using code will return the error message you were getting. If you must use an On_Open event you have to open the report...
pass the text box name as a parameter into the function
Function Change_Color(textbox)
.
.
.
End Function
So when you call it in the On Click event
Sub Command_Click
Call Change_Color(textboxname)
End Sub
I found a round about way to solve your problem.
Add a text box to your form. If the item is not in your combo box have the user enter it in the text box then use an even to add the item to the list. To prevent mistakes you should use a command button. Here is a sample
Private Sub...
How did you create the combo box? How many columns are in your combo box both visible and not visible? to view this go to properties for the combo box, under the format tab look at the column count. If the column count is greater than 1, you need to have the 'bound column' to the delivery place...
Place your end if statements after your else statement
If i = 1 then
.....
Else
.....
End if
If ...
...
Else
..
End If
And so on.
You also forgot to put the i in Next i
-mike
Use this in your record selection
({F43121.PRLNTY} = "C " OR {F43121.PRLNTY} = "CS" OR {F43121.PRLNTY} = "CJ") OR (({F43121.PRLNTY} = "S " OR {F43121.PRLNTY} = "NS" OR {F43121.PRLNTY} = "J1" ))
Thats saying that the value in Field1...
You want to count the number of commas plus one
a, b, c, d
four items, three commas
counting commas is easier, just add one to the final count and that's your final item count. you want to count every instance of the character ","
You want to count the number of commas plus one
a, b, c, d
four items, three commas
counting commas is easier, just add one to the final count and that's your final item count
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.