Is it possible?
I would like to place the following inside a textbox:
There are =Count("MyDataSet") records found.
But if I place that in the expression on the textbox it just displays as above instead of getting the value.
Now I know if I were to split the above in two different textbox works ok but for spacing reasons it would be better if I could just use one?
Is that possible?
You need an expression in the textbox that specifies the text strings and concatenates these to your count value, something like:
="There are " & CountRows("MyDataSet") & " records found"
Related
I am writing a program, and I need to be able to check whether a certain 'tag' exists, by looking at all the 'tags' in the column 'CowTagMain' of the 'CowTable' table.
The code I am using is,
DLookup("[CowTagMain]", "[CowTable]", "[CowTagMain]") = Tag ...
Where tag is a String, TagMain is the column, and MainTable, is the table I am fetching data from.
I am getting inconsistent results, when I try this with 18C, it returns true. While if I try this with 18, it returns false.
I would assume I am fundamentally misunderstanding how to use DLookup, but after searching the internet for hours I cannot understand what I am doing wrong.
Even just pointing me in the right direction would be very appreciated! I am new to working with Access and VBA.
The search criteria is not within the function WHERE CONDITION argument.
The field is text type so need apostrophe delimiters.
Consider:
If IsNull(DLookup("[CowTagMain]", "[CowTable]", "[CowTagMain]= '" & Tag & "'")) Then
I'm having a strange situation:
I have a simple form with 2 text boxes.
The second one has the vba code triggered after being updated.
For example: typing value to the first field, ENTER, typing value into the second field, ENTER and the code starts.
The code, initially, takes the values from the text boxes and assign them to the string variables (pre declared as strings), like:
test1 = Me.frmSSN.Value
The problem is, the test1 variable seems to be empty after the line above.
It seems to happen only when I type, for example this string:
073QB8KJ2D00A4X
It works fine, when entering CNB0K2W5JK
The tool is a simple serial number comparison.
Just for test, I've entered this line into the code:
aaa="073QB8KJ2D00A4X"
When running in the step-by-step mode and hovering mouse over the "aaa" I'm getting: aaa= and then nothing.
Not even single "" like aaa="" or so. Just aaa=
After retrying multiple things - I believe it's about the value I enter:
073QB8KJ2D00A4X
Could be, that for access/vba it's some control string or so?
I'm just dumb now...
Thanks in advance for any help
Marek
p.s. Source fields are plain text boxes. And here's the code:
Dim user As String
Dim 1stSN As String
Dim 2ndSN As String
1stSN = Me.frmSSN.Value
2ndSN = Me.frmHPSN.Value
Then the values are being used as a part of SQL query. The problem is - in this situation - query doesn't work, as the sql string looks like:
"Select * From sbo_SerialSource where SN like " and nothing after "like".
Debug shows the correct value (with serial number), but query fails with "syntax error" message. Seems like there are some strange "control characters" are being created/added.
That's it.
And I have to use the serial numbers as these "strange ones", because that's how they come from the vendor.
I currently have a text box within a table that displays multiple stores based on user parameter input. The problem that I am experiencing that I would like to have a hanging indent that will force the store name to indent once it wraps to the next line (see screenshot).
Is this possible? I am aware that I could put the "Stores:" in it's own textbox, however this makes it difficult when it comes to lining up report items to prevent hidden/merged cells/columns during export to Excel.
The code that I am currently using in the text box is ="<b>" & Microsoft.VisualBasic.Interaction.iif(Parameters!StoreKey.Count > 1, "Stores: ", "Store: ") & "</b>" & Microsoft.VisualBasic.Strings.Join(Parameters!StoreKey.Label, ", ")
The Textbox property you're looking for is called HangingIndent. Try setting it to -10pt.
You could use a table, in the first column you put "Stores: ", in the second the string value, set the borders to none and finally play a little with the alignment (First column top-right alignment & Second column top-left alignment, its your choice) to make it look as if it was all in a single text box.
Is it possible to get right of "~" char in advance datagrid column ? I've tried itemRenderer property but no success. For example, I want to remove all repeated occurrence of "102.Dangerous Flora" and just to keep right of "~".
ArrayCollection is set as data provide for the grid.
alt text http://4.bp.blogspot.com/_T_-j3ZLqfNQ/TE6C_dgi6mI/AAAAAAAABqU/LFNf_bOK3zQ/s1600/3.PNG
use like this.....
for that sign use these without space
& # 126 ;
i would like to force the textbox to immediately change the text to UCASE as soon as the user moves away from the field. is this possible?
the important thing is that this text will be used in a SQL query to update a table.
In the after update event of the text box on the form, simply go:
If isnull(me.MyTextBox) = false then
Me.MyTextBox = ucase(Me.MyTextbos)
End if
You can also specify a input mask on the form.
">LLLLLLLLL"
The above ">" will force all chars as you type to upper case. The number of L is a any char mask. (and, you don't need the " around the input mask)
Solution from Albert don't work for me.
I use this method: put form in "design view", select the control, in the property sheet, in the format tab, in the format property insert the value ">" w/o quotes.