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...
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...
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...
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...
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...
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)...
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...
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.
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?
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...
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...
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.
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...
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...
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...
I'm trying to get an ID from a table and the criteria isn't right. If I use frm.name, it returns "frm.name = "frmCheck".
Dim frm as Form
From Calling Form: me
CallsID = DLookup("CBOCallsID", "tblCBOCalls", "CallingForm =" & frm(name))
This returns name = "Microsoft Access" ---...
I've had this code in my samples for a long time and it works great in a form module. Since I'd like to use it in several places I tried to make a module and now I can't get it to work. I can't get past line 10. I think the error may be frm. Is this the proper way to return a form name? ...
In order to transfer amounts from one account to another I have a subform that's
connected Master = TransactionID ; Child = TTransID. So a new record is created
with a new fAccountID (combobox). What I can't figure out is how to get the new record ID (orange)
into the original TTransID so that...
Private Sub Form_Click()
Dim bm As Variant
Dim rs As Recordset
10 Set rs = Me.Parent.RecordsetClone
'save the bookmark
20 bm = Me.Bookmark
30 With rs
40 .FindFirst "InvoiceID =" & Me.InvoiceID
50 If Not .NoMatch Then
60 Me.Parent.Bookmark =...
To keep from dragging things down I have a default of choosing only the current year transactions.
If I choose Current year, it works
If I choose All, it works
If I choose Current year after choosing all, it works
I cannot choose All after choosing current year. It just keeps returning current...