I *am* happy with the solution. I think one form would have been slicker and one less click for users, but probably more trouble than it was worth to implement.
My handle comes from a nickname a friend gave me...Wyvern/Wyv, as in the dragon. And the EyeView part comes from my being a photographer... so I see the world through a Wyv's Eye View, you might say.
How about NeoPa? Care to share?
User Profile
Collapse
-
Hi NeoPa...I talked this over with the friend who gave me the original suggestion and I think I have concluded that I need two forms; one form can't do what I want. So I think I will have one form on which I select the topic to associate with the document, and that form will be populated using the date-filtered query (the second one in my earlier post, I believe). My current form will no longer be used to select the topic, but will only display the...Leave a comment:
-
Okay...maybe I'm not explaining myself well or not understanding your question, so I'm going to be really explicit here (probably overdo it) and maybe somewhere in my rambling I'll answer what you're asking :)
Originally, I set up frmProdDocTopic s (actually sfrmProdDocTopi cs) to display only the topics associated with the active document in tblProdDocTopic s. The first query in my reply #3 is the RecordSource for sfrmProdDocTopi cs....Leave a comment:
-
Thanks, NeoPa, but this query returns all the active topics from tblTopics, regardless of their last edit date. I just want the ones that are active *and* edited in the last 3 days or 5 days or whatever the user enters. So I think I do need an AND clause rather than an OR clause.Leave a comment:
-
This is the selection criteria for items currently displayed:
And this is the query that I want to use to initially populate the combo box based on last edit date:Code:SELECT tblProdDocTopics.DocTopID, tblProdDocTopics.DocID, tblProdDocTopics.TopicID, tblProdDocTopics.order FROM tblProdDocTopics WHERE (((tblProdDocTopics.DocID)=[Forms]![frmDocs]![nbrDocID])) ORDER BY tblProdDocTopics.order;
...Leave a comment:
-
date-limited query hides previously-selected items in combo box
I have a datasheet subform on which users select a topic from a combo box populated by a query, qryListTopicsCb o. This query limits the list to only those topics edited within the last n days (where n is supplied by a field on another form). The problem I am having is that if a user has selected a topic in the past but its last edit date now falls outside of the n range, that topic no longer appears on the form. Obviously, I want topics already selected... -
I just wanted to announce that I finally cobbled together a solution for this. Rather than try to put my SQL directly in the code, which was proving infuriatingly problematic, I just decided to save the queries and call them by name from the code.
So my approach was:
1. copy the topic and create a new record in tblTopics
2. copy the topic's attributes and create new records in tblTopicAttribu tes with no topicID
...Leave a comment:
-
Perfect! Makes absolute sense once you understand what's happening. Thank you, Stewart. I'm going to look up "loops" to be sure I understand what is and isn't one :)Leave a comment:
-
If..Then..loop not working for MsgBox
I want to display a message box with Yes, No, Cancel buttons and execute different code depending on which button is clicked.
...Code:strMsg1 = "Click a button" If MsgBox(strMsg1, vbYesNoCancel) = vbYes Then 'code A here ElseIf MsgBox(strMsg1, vbYesNoCancel) = vbNo Then 'code B here ElseIf MsgBox(strMsg1, vbYesNoCancel) = vbCancel Then 'do nothing End -
Okay, I am taking another approach altogether. It's not as elegant as what I was trying for here but I understand it and can make it work. I have one last obstacle to overcome and then I think I will be on my way.
After creating the new topic, I then want to run this SQL to copy all attributes associated with the old topic and create new identical records, except, of course, with the top_id now being the id of the newly-created topic....Leave a comment:
-
Okay, I am finally returning to this issue because I feel like a little more self-flagellation. I think I might be getting closer to a solution. Essentially, here is the approach:
Use INSERT statement to create the new topic record but do not move to it on frmTopics.
Use INSERT statement to create new attribute records by selecting those associated with the topic currently in focus on frmTopics.
Use DMax() function to...Leave a comment:
-
The fields I'm referring to are actually bound :) I understand why unbound field values would not persist--it is, as you said, completely logical. I think I just didn't explain myself very well, but at any rate, I discovered a way to work around the issue. Thanks for the input.Leave a comment:
-
Before making these changes, I was leaving orphaned records, which is why I implemented this approach. Unless I have missed something, my current Delete button code will delete the main record and any related records, thus avoiding orphaned records. All my tests seem to indicate that is what is happening.Leave a comment:
-
best approach for limiting length of combo boxes on datasheet forms
I have a datasheet form in which one field is a combo box that will potentially contain hundreds of records. I've read about several methods of speeding up such combo boxes or limiting their initial contents and I have used those methods on "form view" forms, but they don't lend themselves to datasheet forms. One thing, of course, is to set the Row Source programmaticall y using the OnEnter event and to limit the Row Source based on a query... -
Thanks to both of you! Linq, you were right in that I was deleting the main record, then trying to delete the related records. Duh. ADezii, I'm always nervous about cascading deletes because it's so easy for a user to delete more than they mean to, and frankly (though this may be lazy of me) too intricate for me to then programmaticall y make sure they don't. So I didn't make that change but I did take your other suggestions and now have the code...Leave a comment:
-
delete current records & related records together
Upon clicking Delete to delete the current record on frmTopics, I want several things to happen:
1) Display a custom message rather than Access's standard "You are about to delete n records" one.
2) Delete the record.
3) Delete all related attribute records.
4) Go to a new record.
Here is my code:
...Code:Private Sub cmdDelete_Click() On Error GoTo Err_cmdDelete_Click
-
That is perfect. And hugely self-evident...I'm smacking myself for not having thought of it! Thank you!Leave a comment:
-
display selection parameters on report
I have a form on which users select various search parameters and then click a View button to display a report of the results. I would like to display the search parameters used on the report itself so users can easily see what the results are for. I have tried adding both labels and text boxes to the report and setting their values to the values of the search form but the report does not accept either Me.xxxxx.Value or Me.xxxxx.Captio n. I tried... -
Well, I really do want to do things the most efficient and correct way, for several reasons. One, just because it's the right thing to do :) Two, I have visions of converting this to a SQL Server db at some point (way) down the road and the tighter my code is the more successful that conversion will be. I'm a technical writer and I'm developing a content management database that's based somewhat on one that I developed for my own team a while back....Leave a comment:
-
This code sort of works. I say "sort of" because when it opens frmTopics, frmTopics is behind frmTopicsFound and cannot receive focus until I close frmTopicsFound--as if frmTopicsFound is modal. That is not the result I want. I would prefer frmTopics to have the focus on opening.
Also, using "my" code, I can open frmTopicsFound on its own, kludge the query via the parameters box, double-click the topic ID and frmTopics...Leave a comment:
No activity results to display
Show More
Leave a comment: