looking at the code, it is only ever going to populate the form with one record. It might run through all the records but each time it is going to replace the data on the form.
What exactly are you trying to do?
Hey
Sorry i'm struggling to think of a solution. You could try replacing the code that runs the macro with:
docmd.Rename "Years", acTable, "NewYears"
That should do the same thing that the macro was doing but when it comes up to debug you should be able to debug easier.
The function provided above would have given you the number of spaces but as SkipVought said, the Trim function will allow all spaces at the beginning and end to be removed:
Example:
dim str as string
str = " Testing "
output = trim$(str)
Output would then equal "Testing
just a slight correction:
[code]
Msgbox Len(r.value) - Len(Trim(r.Value)) & " spaces in " & r.Addrress
[/code/
You need to get the length of the trimmed string
What exactly does that macro consist of?
Are you sure that the souce table to rename is spelt correctly?
as i'm sure you can understand its a bit hard to fix code when its in a macro i cant see.
What exactly do you mean by sum the spaces? Do you mean you want to count how many characters are spaces?
Also, whats this needed for? Is there a specific need to count the spaces?
Try the following:
SELECT KRTMSTR.CUSTDOD, iif(sum(KRTMSTR.OBL)>1000, "$" & str(format(KRTMSTR.OBL / 1000000, "0.00")) & "M", "$" & str(format(KRTMSTR.OBL, "0.00"))) AS [TLVAL]
FROM CMODOAC INNER JOIN KRTMSTR ON CMODOAC.DODAC = KRTMSTR.CMODOD
GROUP BY KRTMSTR.CUSTDOD;
P.S. Sorry if it doesnt...
You could use something like the following
dim i as integer
dim number as integer
'Whatever the record number that your copying is:
number = 1
set rs = currentdb.openrecordset("select * from Table1 WHERE recordnumber = " & number ";")
set rs2 = currentdb.openrecordset("Table2")...
Hi
Could you put the tlval expression to something like the following:
iif(sum([valuefield])>1000, "$" & str(format([valuefield]/ 1000000, "0.00")) & "M", "$" & str(format([valuefield], "0.00")))
Obviously [ValueField] is the field that you are needing to sum
Steve
You could always save the file with a "full access" password so it will force people to open as read only, therefore they wont be able to save unless they "save as
Might sound like a silly question buy have you got the same version of office installed on all the computers?
Also, have you tried the code with excel running in the background?
If i'm understanding you correctly, you mean you need to enter multiple values against one record so you are using a multiline textbox and seperating by a character return?
If this is the case, would it not be easier to store these multiple values in another table and link the multiple records...
When you say you tried Ucase, how did you use it?
The following should work:
i = InputBox("Type Text or Number to be Searched")
j = 0
For Each r In rng
For iCol = 2 To 11
With Cells(r.Row, iCol)
If ucase$(.Value) = ucase$(i) And j = 0 Then
Steve
I believe the above answer is enough but just incase you didnt want the query to actually exist as an object, you could run the SQL statement that the query is running from by using Docmd.RunSQL function
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.