Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
SQL Server BE Conversion
Donald Lader 
      
2 years ago
Has anyone converted the Time and Billing template and the Amortization 2.0 templates to work on a SQL Server back end. I am slowly moving to SQL Server and have my primary database converted. If you have made the conversion your experience would be helpful in identifying what queries need modification. Thank you.
Kevin Yip  @Reply  
     
2 years ago
The SQL statements themselves most likely don't need modification.  Once the SQL Server tables are linked in Access, Access will see them as "Access tables," just like it sees Excel tables, CSV tables, etc., as Access tables when they become linked tables.  You need modification only when you want to turn your Access queries into "server-side" queries that run directly on SQL Server, in which case the queries have to be rewritten in SQL Server syntax.  For instance, the Access function InStr() needs to be changed to the CHARINDEX() function in SQL Server.  There are many other differences in the syntax, so you generally only make such changes when there is (much) performance gain to be had.  In my old job, I only moved a few queries to SQL Server, and a majority of the Access queries remained where they were, unchanged.
Alex Hedley  @Reply  
           
2 years ago
Did you complete the Access SQL Server Online?
Donald Lader OP  @Reply  
      
2 years ago
Alex, I have completed the Access SQL Server Online. Kevin, most of the Amortization works. However, when I open the client form, the subform does not appear.  I have narrowed it down to the query used on the subform, LoansForCurrentClientQ. When I attempt to run just the query, it returns blank rows. I see Richard has used some criteria in the query that I am not familiar with, and I am beginning to believe this may be the problem. If anyone could look at this and let me know if the criteria are the issue, that would be helpful.  Here is an example of the criteria used in one column: [Forms]![ClientF]![ClientID]. I understand what the criteria do; the question is, will this work with SQL Server? The query runs fine on a local database without SQL Server.
Kevin Yip  @Reply  
     
2 years ago
Hi Donald, I don't have access to the template so I can't provide specific help.  But usually you don't have to change your queries, because you are still using the same Access SQL syntax to access tables on SQL Server.  If queries sometimes work and sometimes don't, the problem may lie elsewhere in the template.  Hopefully someone with the template can help you.

Donald Lader OP  @Reply  
      
2 years ago
I have this working now. I had to modify the LoansForCurrentClientQ by removing the criteria for IsActive. Then I added some VBA as shown in my Public Module:

DetailsPublic Sub UpdateLoanList()
    Dim db As DAO.Database
    Dim qdf As DAO.QueryDef
    Dim sql As String
    Dim showActiveLoans As Boolean

    ' Get the current value of the ShowActiveLoans checkbox from the ClientF form
    showActiveLoans = Forms!ClientF!ShowActiveLoans

    ' Define the base SQL statement for the query
    sql = "SELECT LoanID, ClientID, LoanAmount, StartDate, Description, IsActive " & _
          "FROM LoanT " & _
          "WHERE ClientID = [Forms]![ClientF]![ClientID]"

    ' Add criteria for IsActive based on the ShowActiveLoans checkbox
    If showActiveLoans Then
        sql = sql & " AND IsActive = True"
    End If

    ' Create a temporary QueryDef
    Set db = CurrentDb()
    Set qdf = db.CreateQueryDef("", sql)

    ' Set the RowSource of the LoanList control to the temporary QueryDef
    Forms!ClientF!LoanList.RowSource = qdf.SQL

    ' Requery the LoanList control to show the updated data
    Forms!ClientF!LoanList.Requery

    ' Clean up
    Set qdf = Nothing
    Set db = Nothing
End Sub


Then I added the following to the form:

Private Sub ShowActiveLoans_AfterUpdate()
    Call UpdateLoanList
End Sub


Private Sub Form_Load()
    Call UpdateLoanList
End Sub


So far, the template now appears to work correctly but I am still in testing mode.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/16/2026 1:44:45 PM. PLT: 1s