On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.
Private Sub Merge_Click() ' ********* Check Bit ********* If Len(Me!TextName & "") = 0 Then MsgBox "You must add a Name", vbExclamation Cancel = True Exit Sub End If DoCmd.Save Dim rs As DAO.Recordset, uSQL As String Set rs = CurrentDb.OpenRecordset("select * from [Tbl-SavedSearches] where merge=-1") uSQL = "" Do Until rs.EOF uSQL = uSQL & " Union All " & rs("SearchString") rs.MoveNext Loop rs.Close uSQL = Mid(uSQL, 11) Debug.Print uSQL ' ********* Save Bit ********* Dim rs1 As DAO.Recordset Set rs1 = CurrentDb.OpenRecordset("tbl-SavedSearches") rs1.AddNew rs1!SearchName = Me.[TextName] rs1!SearchTime = Now() rs1!SearchString = uSQL rs1.Update rs1.Close Dim stDocName As String Dim stLinkCriteria As String stDocName = "Frm-SavedSearches" DoCmd.Close acForm, "Frm-SavedSearches" DoCmd.OpenForm stDocName, , , stLinkCriteria DoCmd.Close acForm, "Frm-Merge-Searches" End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|sIMULTANEOUS USAGE ON NETWORK-ACCESS 2010-2013||7||69|
|SQL Query logic question||14||66|
|T-SQL: need to reset a declared variable||4||25|
|SQL - Result of a formula to decimal (not integer) value||7||9|
Join the community of 500,000 technology professionals and ask your questions.