Search results

  1. C

    syntax error with null values

    I'd like to insert a record: strSql = "INSERT INTO tblTransactions" & _ " ([fAccountID]" & _ ", [fNameID]" & _ ", [CkDate]" & _ ", [Num])" & _ " VALUES" & _ " (" & Me.cboAccount.Value & _ ", " & frm.cboFullName.Value & _ "...
  2. C

    Solved Using a query to filter a different query

    Probably an oft repeated question but I can't seem to find the right question to get an answer... I have FormA based on a calculated query. When I call FormB using FormA.Filter, the filter uses FormA query field name which doesn't work on FormB query field names even though they are both using...
  3. C

    Change backcolor on account change

    I have a form of Accounts with a subform of register. The subform is Parent/Child Account number. I'd like to tie the register background color to the account color. I can't figure out which event to use. Change of account triggers the Parent/Child connection. So I tried the Current Event...
  4. C

    Get 2 values from popup

    @MajP posted this function for retrieving values from popup forms: Public Function getValueFromPopUp(formName As String, PopUpControlName As String, Optional MyOpenArgs As String = "None") As Variant 'FormName: Name of the popup form 'PopupControlName: Name of the control on the pop...
  5. C

    hidden button is the active control

    I have a hidden button that calls a calculator (with a shortcut key). There are several fields on one form that use this button so I need to know the field name that's calling the button. Me.ActiveControl.Name returns the hidden button. How do I get the name of the field that is actually...
  6. C

    limit date formula as variable

    I have a combobox that I want to limit dates in a listbox: Function DateCalculation(IDate As Integer) Select Case IDate Case 48 'All Dates [CkDate] Case 49 'This Month Year([CkDate]) = Year(Date) And Month([CkDate]) = Month(Date) Case 50 'Last...
  7. C

    finding an empty record

    I want to find a record that meets several criteria. SELECT tblLocation.*, tblLocation.fItemID, tblLocation.InUse, tblLocation.Parent FROM tblLocation WHERE (((tblLocation.fItemID) Is Null) AND ((tblLocation.InUse)=False) AND ((tblLocation.Parent)="DR2")); This query returns 15 available...
  8. C

    Module variable

    I have a module with a simple routine to position the form to the last record Public Sub RepositionForm(frm As Form) 10 On Error GoTo RepositionForm_Error Dim strWhere As String 30 strWhere = "LocID = " & lngLoc 70 frm.Requery 80 With frm.RecordsetClone...
  9. C

    Majp Search and Filter

    I'm using Majp's MultiControl Search to create a search form. My object is to filter a subform with numerous fields. 1. I have a search box to type in whatever I'm searching for. 2. A listbox with a list of fields to search in... $25 in Amount, Jones in Name, etc. 3. A listbox with the various...
  10. C

    popup calculator

    I downloaded the popup calculator Majp posted (who knew there was such a thing?). I like it but now I want to get fussy: 1. I set the equal button to default so I could press enter without it closing so I can see what the value is before accepting it. Doesn't work 2. Why doesn't the calculated...
  11. C

    control variable

    Public Function FldCalc(frm As Form, ctrl As Control) On Error Resume Next Select Case ctrl.Name Case "txtPayment" If Left(frm.ctrl, 1) = "=" Then frm.ctrl = Right(frm.ctrl, Len(frm.ctrl) - 1) frm.Payment = 0 frm.Payment = Eval(frm.ctrl)...
  12. C

    Solved TempVars as Query criteria

    I have an option box to return only current year or all transactions If Me.frameLimit = 1 Then TempVars("datelimit") = "Year([CkDate]) = " & Year(Date) Else: TempVars("datelimit") = "1=1" End If I'd like to use this limit in the subform query but putting [TempVars]![datelimit] in...
  13. C

    syntax error

    This is giving me a serious headache strWhere = TempVars("DateLimit") And & TempVars("AccountID") DateLimit is "Year([CkDate]) = " & Year(Date) and AccountID is long (autonumber) I've tried quotes all over the place and nothing seems to work.
  14. C

    pdf shrinks report

    I have a report that I need to print in booklet form. If I run it to Word it loses a lot of formatting. If I run it to pdf it shrinks the pages. Is there something I'm missing?
  15. C

    Return an empty register

    I have a form of accounts and a subform register of transactions. Clicking on a transaction opens a form to edit current transaction or create a new one. If the account has no transactions, it does not return an account ID or the name of the account. If I've created a new account, the register...
  16. C

    Query return on alias fields

    I created a helper table for some small tables I.e. tblCombo for color, type, group, etc. So then I use Pat Hartman's Address Book. It worked great until I created the helper table. Using her code to BuildSql I get: SELECT tblCategory.CategoryID, tblCategory.Category, tblCombo.Data AS Type...
  17. C

    Aggregate query loses aggregate

    I have a query that groups transactions together by ID: But when I use this query and add another table it loses its grouping: What am I doing wrong? The addition table is left join.
  18. C

    AfterUpdate double amount

    I’ve worked on this so long that I can no longer see the trees for the forest. I want to transfer money from one account to another so (on your advice) I’ve created a self join table. Mostly this works except for when there is more than one transfer (bottom subform) in the Check. The code on...
  19. C

    Solved Totals Query

    SELECT qryTransactions.TransactionID, qryTransactions.Cleared, Nz(-[Credit],0)+Nz([debit],0) AS CkAmount, -Nz([CatCredit],0)+Nz([CatDebit],0) AS CatAmount, qryTransfers.TAmount, Sum(IIf([Cleared]=True,+[CkAmount],0)) AS ClearedAmt...
  20. C

    Solved NotInList error

    I apparently don't understand the NotInList function. I have several comboboxes so I made a separate module sub called EditCombo to carry out various actions for different kinds of combos and then return to the line "Me.cboPayee = null", etc. Everything works except when the code runs to the End...
Back
Top Bottom