C
Craig
Am using using the following code to create a new query - what I would like
to do is if the query name exists, then add in incremental number.
something to the effect of .... if qname already exists then num = num + 1
and qname = "Cqry" & num
Any ideas on how i would work this.
Thanks
Craig
Dim curdatabase As Object
Dim qrydef As Object
Dim qname As String
Dim num As Integer (or should this be string)
num = 1
qname = "Cqry"
Set curdatabase = CurrentDb
Set qrydef = curdatabase.CreateQueryDef(qname, "Select * from tblContact")
DoCmd.OpenQuery qname, acViewDesign, acEdit
to do is if the query name exists, then add in incremental number.
something to the effect of .... if qname already exists then num = num + 1
and qname = "Cqry" & num
Any ideas on how i would work this.
Thanks
Craig
Dim curdatabase As Object
Dim qrydef As Object
Dim qname As String
Dim num As Integer (or should this be string)
num = 1
qname = "Cqry"
Set curdatabase = CurrentDb
Set qrydef = curdatabase.CreateQueryDef(qname, "Select * from tblContact")
DoCmd.OpenQuery qname, acViewDesign, acEdit