

In case you additional materials for your assignment, you will be directed to ‘manage my orders’ section where you can upload them. You also give your assignment instructions. The information needed include: topic, subject area, number of pages, spacing, urgency, academic level, number of sources, style, and preferred language style. Filling the forms involves giving instructions to your assignment. I have copied the contents of the SQL-view in Access in the Word VBA-editor in order to avoid typing mistakes.It is very easy. StrSQL = "SELECT Language.LanguageID FROM Language", commented out in the above code, the error occurs as well. My code calls GetDivisieID, which works fine, and immediately thereafter calls GetTaalID, which produces run-time error 5: "Invalid Procedure Call or Argument" when executing varResult = StartQuery(. ReDim Preserve strResult(UBound(strResult) - 1) If Not (UBound(strResult) = 0 And strResult(0) = "") Then StrConn = "Provider=.12.0 Data Source=" & strDB & " " StrDB = modPaden.OWDatabase ' path to the database Private Function StartQuery(SQL As String, SortString As String, FunctionName As String, Scheidingsteken As String) As Variantĭim conn As ADODB.Connection, strConn As String, rs As ADODB.Recordsetĭim lngN As Long, strResult() As String, strDB As String ' StartQuery() merely exists to avoid duplicate lines of code VarResult = StartQuery(SQL:=strSQL, SortString:="", FunctionName:="GetTaalID", Scheidingsteken:="") ' strSQL = "SELECT Language.LanguageID FROM Language" StrSQL = "SELECT LanguageID, Description FROM Language WHERE Description='" & TaalAfk & "'" VarResult = StartQuery(SQL:=strSQL, SortString:="", FunctionName:="GetDivisieID", Scheidingsteken:="")įunction GetTaalID(TaalAfk As String) As String StrSQL = "SELECT Description, DivisionID FROM Divisions WHERE Description='" & Divisie & "'"

accdb database with two extremely simple SQL strings:įunction GetDivisieID(Divisie As String) As Stringĭim strSQL As String, varResult As Variant
