Thanks for the suggestions, however there are some hooks to consider.
There is a linked form which appears on the screen, at the same time as the mainform/subform, so I cannot make it a popup as it restricts access to the linked form.
Also setting Auto Resize On makes no difference to the...
Me!textCompanyName.Value = Me!cboCompany.Column(1)
Sheesh, that's more or less identical to the code I'm using, but I keep getting the "Can't assign a value to this object" error. Any ideas on this one?
Also Form.AllowEdits & .AllowAdditions are set to True.
help!
RK
...is. I've read extensively in these threads but cannot find any clear direction.
Im using A2K in WIN2K environment.
Here are the Format settings:
* Mainform
Single Form
ScrollBars - neither
Record Selectors - No
Navigation Buttons - No
Auto Resize - No
Auto Center - No
Border Style - Dialog...
Solved my own problem -- just forced a form recalc before doing the Dsum:
Me.Recalc
It would be nice to know why it wasn't working, but my guess is it's something to do with "dirty" records??
RK
Im trying to the Dsum value from a table, immediately following the addition of data to the new record's last field: Amount. For reasons unknown to me, the Dsum only sums across other table records, and does not include the newly added record.
What is the accepted workaround for this problem...
I've restructured the code, given the prior outcome. My filters were part of the MovePrev, MoveNext buttons code. I'm now applying the Filters in the On Current event, immediately before the subform recordcount, with success.[medal]
I'll now go back to AddFirstDrop procedure and see if I can...
I've just retraced the steps of On Current and it is still doing some rather archaic counts.
Here's what happened:
ER: Order 1 -- M Items 1 -- M Drops
The Order record (#130) is set as follows:
ItemID# DropID#
10 1
11
1 When i open the OrderItem mainform
Item# 10 has 1...
Thanks Roy, Ive implemented your suggestions and came to this roadblock:
The mainform is debugging at statement:
Me!subformItemDrops.Form.AddFirstDrop
with the error 2105: You can't go to the specified record.
This all seems rather odd as I've already trapped the empty recordset with...
Seems I inadvertently put the code in the subform On Current event - douh! moved it to the mainform and voila.
My sub to add the new record (when recordsetclone.recordcount = 0) is located in the subform:
Sub AddFirstDrop
dim dtInitialDropDate
dtInitialDropDate = fnSetDefaultDropDate...
Oops I spoke too soon.
Seems neither recordset.recordcount, nor recordsetclone.recordcount can count a filtered group.
If I filter on the OrderItem before any record is in ItemDrop, I can't explain why, but both types of Recordcount omit the empty ItemDrop record and see the recordcount for...
I'm trying to fire a procedure from VBA without much success...
I have OrderItems (mainform), each OrderItem can have several Drops to customer (subform). When I navigate the OrderItems I want to add one default Drop per OrderItem.
My problem is I can't trap an empty recordset in the subform...
Thanks Bob, but Ive wasted too much time on this one already. Pressure from the client has forced me to move on to other more important things. I'll just implement something less elegant than what I was aiming for.
cheers
RK
"The customer is always right, when they're paying for it.
All appears to be well at the function end. I wrote a query just to call the function and that worked returning the expected result onscreen.
I used the original query without the WHERE clause and that worked.
I called both queries from the form and got the same "Too few parameters" error...
...tblCOMPANY.co_ID, tblCOMPANY.co_NAME, fnSearchStr([Forms]![fmAddCustomer]![txtCompName]) AS X
FROM tblCOMPANY
WHERE (((tblCOMPANY.co_NAME) Like "*" & fnSearchStr([Forms]![fmAddCustomer]![txtCompName]) & "*") Or ((tblCOMPANY.co_NAME) Like...
...tblCOMPANY.co_NAME, fnSearchStr([Forms]![fmAddCustomer]![txtCompName].value) AS X
FROM tblCOMPANY
WHERE (((tblCOMPANY.co_NAME) Like "*" & fnSearchStr([Forms]![fmAddCustomer]![txtCompName].[value]) & "*" Or (tblCOMPANY.co_NAME) Like fnSearchStr([Forms]![fmAddCustomer]![txtCompName].[value]) &...
Thanks Bob & Ken for your feedback.
It was the SQL alias reference in the WHERE statement that was incorrect. My SQL is *indeed* very rusty :)
cheers
RK
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.