yeah, if you have a table with firstname, surname address, post code etc... Select all of those column names and each label will have the info from a separate row when you do the merge.
Hope that makes sense.
Rich
Hi Gill
If you already have an existing database then you can just create a query based on the table with just the fields that you require.
Depending which version of word you have (mine is 97). Go to tools and mailmerge.
Create main document pick mailing labels if that's what you require...
Do a totals query. Create a new query and select totals in the View menu. A totals field is added to the query, anything you want to do can be entered into the total field i.e. count, sum, max, min etc
HTH
Rich
Your original code should work if you add an extra line to specify the cursor type. The default cursor type is acForwardOnly, you have to set it to openKeyset or OpenStatic.
Look at CursorType in help and RecordCount (tells you why -1 is sometimes returned)
This line should do the trick...
Hi Helen
I think the syntax is wrong you need to put quotes around the field name as well as [].
if DCount("[fieldname]", "query1") = 0
Also, are you putting in the name of your field as it appears in your query. You have put "Campaign Test Cell subform" this doesn't sound like a field name...
Have you tried using DCOUNT?
if DCount("[yourfield]", "yourQuery") > 0 then
perform action
look up Dcount in help or search the forum as it comes up a lot
Rich
Hi Sharontha,
You could achieve this in a function, SEE BELOW.
I've tested this and it seems to work for each scenario.
Function test()
Dim mystring As Single
Dim mypos As Integer
Dim zerosneeded As Integer
Dim i As Integer
Dim zeros As String
Dim position As Integer
mystring =...
Not sure, but this could be the problem:
11,99
should it be 11.99?
I think access does not recognise a comma as a decimal point, so 11,99 is read as 1199. Therefore 1199 is greater than 12.
The comma is used to make a large number more readable (I think).
Rich
I can suggest something like this as a starting point, I think it may be a good idea to have a command button to perform the calculation (but of course it is up to you, oncurrent event of txtStatus may be better):
Private Sub your CommandButton_Click()
Dim average As Integer
Dim...
Change control box property to "No" as well. This should work, do you mean it is just greyed out at the moment?
How's things up the road in sunny Stafford?
Rich
You could try something like this, depends where you want the names displayed I guess...
Dim I ' Declare variable.
Dim names
For I = 0 To Forms.Count - 1
names = names & Forms(I).Name & " "
Next I
MsgBox names, vbOKOnly, "Forms"
End Sub
Rich
You can reference each column like this:
Me.Combo.Column(0)
Me.Combo.Column(1)
etc
The default is column(0), so you don't need to enter this, but if you want to refer to other columns you have to put the extra bit.
HTH
Rich
Why don't you just base the table on a query? Create a query with the tables you want and add all the fields from the original table(that you had in your form before) and just the one field you need from the other table.
Rich
Hi Amy,
You can do this by going into the form properties, select the format tab and look for the picture field, put the name of the graphic file you want in this field. This should change the form background.
HTH
Rich