Yes i changed the line of code so its revelvent to my project.
So i have no idea whats up with it.
Any more ideas?
john
User Profile
Collapse
-
If I click cancel when the message box comes up. My templete does not merge but the new document does not appear.
ATCLeave a comment:
-
Thanks for all your help NeoPa.
The problem is solved.
I'll take your advise on board.
ATCLeave a comment:
-
Thanks for your help mary. I modified your code for my database. Word loads as expected but word brings up a message box called "select table". It has queries and tables in it. So I select the query I want. Then word loads up a new document called "Form Letters1". It is the same as my template. Is there any way to modify the code so the message box does not appear and the new document is not created.
Thanks again...Leave a comment:
-
Ok thanks for the advice. Sorry that it is making your task to find a solution harder.
JohnLeave a comment:
-
Thanks for your time on this NeoPa
Ok i want to try and not allow duplicates to be entered as you know. By this a mean a list of records like this would be ok:
court 1,indoor court, 07/03/2007
court 2,indoor court,07/03/2007
court 5,outdoor court,07/03/2007
court 1,indoor court,08/03/2007
court 2,indoor court, 08/03/2007
etc
A list like this would not be ok:
court 1,indoor court,07/03/2007...Leave a comment:
-
Do you want me to resend as a zip or is mary going to resend as a zip?
johnLeave a comment:
-
Thanks for your help.
Now I am getting an error for
The error is "QueryStrin g is not a method"Code:objWord.MailMerge.DataSource.QueryString
Also when word is lanuched I have to select the query i want to merge. Is there any way I can get round this.
Thanks again
ATCLeave a comment:
-
Mail merge problem
Sorry but another question from a newbie.
I am trying to create a mail merge based on a query. I have a button on a form (form is based on query). I found this code in one of the discussions and tried to modify it for my needs.
...Code:Private Sub Command36_Click() Set objWord = GetObject("C:\Documents and Settings\xxxx\My Documents\merge.doc", "Word.Document") 'turn off alerts objWord.Application.DisplayAlerts -
-
It's in the subform called BookingSubform at the moment.
JohnLeave a comment:
-
NeoPa
Here are the results from the immediate section:
(CourtID=1) AND (ScheduleDate=# 2/2/2007#)
1 - 2 Feb 2007
(CourtID=4) AND (ScheduleDate=# 2/2/2007#)
4 - 2 Feb 2007
First I tried court 1 for 02/02/2007 (this is a duplicate). Then I tried court 4 for 02/02/2007 (not a duplicate).
Answer to A: yes mary was sent a copy by e-mail
B: The main form is called Bookings....Leave a comment:
-
Hello again. I am now using your code:
...Code:Private Sub Form_BeforeUpdate(Cancel As Integer) Dim strWhere As String Dim varKey As Variant strWhere = "(CourtID=" & Me.CourtID & ") AND " & _ "(ScheduleDate=" & Format(Me.ScheduleDate, "\#m/d/yyyy\#") & ")" varKey = DLookup("[CourtID] & Format([ScheduleDate],'Leave a comment:
-
I have now checked names.
Now have this code
...Code:Private Sub ScheduleDate_AfterUpdate() If Not IsNull(Me.CourtID) Then CheckDate End If End Sub Private Sub CourtID_AfterUpdate() If Not IsNull(Me.ScheduleDate) Then CheckDate End If End Sub Function CheckDate() Dim strWhere As String Dim varKey As Variant
Leave a comment:
-
Ok sorry NeoPa i thought two heads may be better than one. I'll post in the orginal thread.
johnLeave a comment:
-
Thanks for your continued help.
With this code is place (entering the data courtID of 1 and a date of 01/03/2007 - not a duplicate) I get the same message as before but when I click ok it keeps the courtID of the new record, deletes the schedule date and moves to courtID of a new record below.
I also get the same result if the data is a duplicate.
ATCLeave a comment:
-
Thanks for your help. I
have now moved it to the before update event. When I try to input court 1, 01/03/2007 for example (not a duplicate). I get a message of "(CourtID=1 ) AND (ScheduleDate=# 3/1/2007#) 1 - 1 Mar 2007".
I click OK and then have to press escape to exit the cell (cant click out of it). This takes the datasheet to what it was before. So i cant add new records or edit records.
Any ideas?
...Leave a comment:
-
By this I mean court 1 on 01/03/2007, court 2 on 01/03/2007, court 1 on 02/03/2007 etc would be acceptable records.
But court 1 on 01/03/2007 and court 1 on 01/03/2007 would not be.
Thanks
ATCLeave a comment:
-
Thanks so much it works like a charm. Would it be possible for you to try and solve one other small problem. At the moment I have this code
...Code:Private Sub Form_AfterUpdate(Cancel As Integer) Dim strWhere As String Dim varKey As Variant strWhere = "(CourtID=" & Me.CourtID & ") AND " & _ "(ScheduleDate=" & Format(Me.ScheduleDate, "\#m/d/yyyy\#")Leave a comment:
-
When this code is in use I cant add or edit records as before. I get this message this time "(PitchID=4 ) AND (ScheduleDate=# 2/28/2007#) 1 - 28 Feb 2007" when trying to enter pitch 4 and a date of 28/02/07.
ATCLeave a comment:
No activity results to display
Show More
Leave a comment: