Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a Find Duplicate Query to fill a field on a form

Status
Not open for further replies.

LowBrow

Technical User
Jun 1, 2001
100
US
I have the following query:
PARAMETERS Forms!TimeSheet!ClientID Text, Forms!TImeSheet![Date] DateTime;
SELECT DISTINCTROW First(TimeSheet.Date) AS [Date Field], First(TimeSheet.ClientID) AS [ClientID Field], Count(TimeSheet.Date) AS NumberOfDups
FROM TimeSheet
GROUP BY TimeSheet.Date, TimeSheet.ClientID
HAVING (((Count(TimeSheet.Date))>1) AND ((Count(TimeSheet.ClientID))>1));

I want to write a function that runs this query when the user pushes a 'Submit' button, and if the value in NumberOfDups is Null, fills txtDaysPaid (a field on the current form) with a value of '1', else leave txtDaysPaid null. Any and all help appreciated. Thanks!
 
When I run the following code I get an error '91' " Object Variable or with block variable not set". Can anyone please give me a clue as to what I'm missing here. Thanks, GM

Private Sub Command12_Click()

Set appword = CreateObject("Word.Application") '

appword.Visible = True
strdoc = "a:\" & a ' where a is a variable
appword.Documents.Open (strdoc)


ActiveDocument.Select

With Selection.Find

.....(some text) {this is a routine that works, just get past the selection.find statement is the problem for me}

End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top