DblClick Event

I'm new to Access, what am I doing wrong passing these variables to the 
mainform? I need these pasted or set to the control value in the mainform. 
Any help would be appreciated. Thanks

Private Sub Recording_DblClick(Cancel As Integer)

Dim rstInst As Recordset
Dim strRecording As String
Dim strInstDate As String

'Set recordset to Inst table
Set rstInst = dbsCurrent.OpenRecordset("Inst", dbOpenSnapshot)
' Get Recording from subform and set to varible
strRecording = Forms!Ownership![Inst Subform].Form![Recording]
' Get InstDate from subform and set to varible
strInstDate = Forms!Ownership![Inst Subform].Form![InstDate]
Forms!Ownership!Recording.SetFocus
' Set varible to Recording in mainform
Forms!Ownership![Recording] = strRecording 'This Varible has no value
' Set varible to InstDate in mainform
Forms!Ownership![InstDate] = strInstDate 'This Varible has no value
' Cleanup
rstInst.Close

End Sub
0
Utf
10/20/2007 9:49:00 PM
access 16762 articles. 2 followers. Follow

4 Replies
624 Views

Similar Articles

[PageSpeed] 57

blazerklk wrote:
> I'm new to Access, what am I doing wrong passing these variables to
> the mainform? I need these pasted or set to the control value in the
> mainform. Any help would be appreciated. Thanks
>
> Private Sub Recording_DblClick(Cancel As Integer)
>
> Dim rstInst As Recordset
> Dim strRecording As String
> Dim strInstDate As String
>
> Set rstInst = dbsCurrent.OpenRecordset("Inst", dbOpenSnapshot)
> strRecording = Forms!Ownership![Inst Subform].Form![Recording]
> strInstDate = Forms!Ownership![Inst Subform].Form![InstDate]
> Forms!Ownership!Recording.SetFocus
> Forms!Ownership![Recording] = strRecording 'This Varible has no value
> Forms!Ownership![InstDate] = strInstDate 'This Varible has no value
> rstInst.Close
>
> End Sub

Why are you opening and closing a Recordset?  You are never using it.

Do you get errors when this runs or just no values being set?

Is "Inst Subform" the name of the subform *control* as well as the name of the 
form it contains?  The control usually has the same name, but that it not 
guaranteed and it is the name of the control that the syntax requires, not the 
name of the form.

-- 
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com


0
Rick
10/21/2007 12:25:09 PM
I guess there is no need to open the recordset. 
I'm not setting any values to the varibles strRecording or strInstDate. 
The control on the subform is named "Inst Subform", the actual form itself 
is OwnershipSubform. 
The Forms!Ownership![Inst Subform].Form![Recording] and 
Forms!Ownership![Inst Subform].Form![InstDate] both return the values but 
don't set the varibles.
I simply want to copy these two field values to the mainform and there is 
probably an easier way.
Thanks for the reply Rick your help is appreciated.

"Rick Brandt" wrote:

> blazerklk wrote:
> > I'm new to Access, what am I doing wrong passing these variables to
> > the mainform? I need these pasted or set to the control value in the
> > mainform. Any help would be appreciated. Thanks
> >
> > Private Sub Recording_DblClick(Cancel As Integer)
> >
> > Dim rstInst As Recordset
> > Dim strRecording As String
> > Dim strInstDate As String
> >
> > Set rstInst = dbsCurrent.OpenRecordset("Inst", dbOpenSnapshot)
> > strRecording = Forms!Ownership![Inst Subform].Form![Recording]
> > strInstDate = Forms!Ownership![Inst Subform].Form![InstDate]
> > Forms!Ownership!Recording.SetFocus
> > Forms!Ownership![Recording] = strRecording 'This Varible has no value
> > Forms!Ownership![InstDate] = strInstDate 'This Varible has no value
> > rstInst.Close
> >
> > End Sub
> 
> Why are you opening and closing a Recordset?  You are never using it.
> 
> Do you get errors when this runs or just no values being set?
> 
> Is "Inst Subform" the name of the subform *control* as well as the name of the 
> form it contains?  The control usually has the same name, but that it not 
> guaranteed and it is the name of the control that the syntax requires, not the 
> name of the form.
> 
> -- 
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt   at   Hunter   dot   com
> 
> 
> 
0
Utf
10/21/2007 1:07:01 PM
blazerklk wrote:
> I guess there is no need to open the recordset.
> I'm not setting any values to the varibles strRecording or
> strInstDate. The control on the subform is named "Inst Subform", the
> actual form itself is OwnershipSubform.
> The Forms!Ownership![Inst Subform].Form![Recording] and
> Forms!Ownership![Inst Subform].Form![InstDate] both return the values
> but don't set the varibles.

I don't see how that is possible.  If those references return values then either 
your variables will be set to match them or you will get an error.

> I simply want to copy these two field values to the mainform and
> there is probably an easier way.
> Thanks for the reply Rick your help is appreciated.

All you should need is...

Forms!Ownership![Recording] = Forms!Ownership![Inst Subform].Form![Recording]
Forms!Ownership![InstDate] = Forms!Ownership![Inst Subform].Form![InstDate]

....and if you run that code from the Ownership form's module that can be reduced 
to...

Me![Recording] = Me![Inst Subform].Form![Recording]
Me![InstDate] = Me![Inst Subform].Form![InstDate]

Note that if InstDate is actually a DateTime type then using a string variable 
to hold that would not be correct and might have been part of your problem.  I 
should also point out that copying values from a subform to the main form like 
this is very unusual and suggests that your design is incorrect.  Normally the 
only values that are common between main form and subform are those that are 
specified in the MasterLink and ChildLink properties and those are synchronized 
automatically.

-- 
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com



0
Rick
10/21/2007 3:47:51 PM
Rick many thanks, your great. I knew I was doing it 
wrong and re-thought the problem. Thanks again.
"Rick Brandt" wrote:

> blazerklk wrote:
> > I guess there is no need to open the recordset.
> > I'm not setting any values to the varibles strRecording or
> > strInstDate. The control on the subform is named "Inst Subform", the
> > actual form itself is OwnershipSubform.
> > The Forms!Ownership![Inst Subform].Form![Recording] and
> > Forms!Ownership![Inst Subform].Form![InstDate] both return the values
> > but don't set the varibles.
> 
> I don't see how that is possible.  If those references return values then either 
> your variables will be set to match them or you will get an error.
> 
> > I simply want to copy these two field values to the mainform and
> > there is probably an easier way.
> > Thanks for the reply Rick your help is appreciated.
> 
> All you should need is...
> 
> Forms!Ownership![Recording] = Forms!Ownership![Inst Subform].Form![Recording]
> Forms!Ownership![InstDate] = Forms!Ownership![Inst Subform].Form![InstDate]
> 
> ....and if you run that code from the Ownership form's module that can be reduced 
> to...
> 
> Me![Recording] = Me![Inst Subform].Form![Recording]
> Me![InstDate] = Me![Inst Subform].Form![InstDate]
> 
> Note that if InstDate is actually a DateTime type then using a string variable 
> to hold that would not be correct and might have been part of your problem.  I 
> should also point out that copying values from a subform to the main form like 
> this is very unusual and suggests that your design is incorrect.  Normally the 
> only values that are common between main form and subform are those that are 
> specified in the MasterLink and ChildLink properties and those are synchronized 
> automatically.
> 
> -- 
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt   at   Hunter   dot   com
> 
> 
> 
> 
0
Utf
10/21/2007 5:04:00 PM
Reply:

Similar Artilces:

Information Store doesn't start with events 1121, 5000 and 9098
hi, I accidently removed the inheritance permissions from one of the accounts in the Exchange organization group and now the IS won't start. There are ways to repair using ADSIEDIT. When I browse to Configuration - Services - microsoft exchange - First Organization, there is nothing under it. No objects at all. Any ideas? Thanks Follow this article to get the permissions back in. XADM: How to Recover When Only Full Exchange Administrator Account Is Deleted http://support.microsoft.com/?id=296487 James Chong (MVP) On Mar 16, 7:09 pm, Roy <R...@discussions.microsoft.com> wrot...

Event
Hi all, Exist an event that indicate the my view in my program is completly create ? Thanks stefano If you are asking to know when a view is fully created etc., you should look at OnInitialUpdate of your view. Thats the place where you can add controls etc to it. For drawing on the view, you will typically do it in OnDraw/OnPaint. --- Ajay ...

No data event function
Hello. I have many reports and am trying to use a function to display a message when there is no data in the report: "Report has no data." The function seems to work in that if there is data, a report runs with the data. However, if there is no data, the report does not run but "Report has no data" does not appear to the user. I'd appreciate suggestions. Public gfReportHasNoData As Boolean Public Function PrintPreviewReport(pstrReport As String, pfPreview As Boolean, pstrWhere As String) As String 'Comments: Print or preview a report and handle errors 'ps...

Event 9318 and Error 1722
Background Server1 = Exchange 55 SP4 - First Exchange Server in Site Server2 = Exchange 55 SP4 both running on NT4 sp6a. I receive the following error: An RPC communications error occurred. Unable to bind over RPC. Locality Table (LTAB) index: 36, NT/MTA error code: 1722. Comms error 1722, Bind error 0, Remote Server Name Server1 [MAIN BASE 1 500 %10] (14) I have read that is a connectivity error but Server1 has crashed due to a hardware failure. Before the crash I used the move mailbox method to move all mails to Server2. Server1 is now offline but Server2 is still trying to connect. I...

Purging Events
I there a way to purge events in Event Viewer? James Yes Right click on the event and select "Clear log..." Russ -- Russell Grover - SBITS.Biz [SBS-MVP] Microsoft Gold Certified Partner Microsoft Certified Small Business Specialist 24hr SBS Remote Support - www.SBITS.Biz $30 Second Opinion - www.PersonalITConsultant.com Free Trial Microsoft Online Services - www.Microsoft-Online-Services.com "JamesJ" <jjy@darwin_roadrunner.com> wrote in message news:O7gXwpppKHA.5696@TK2MSFTNGP04.phx.gbl... > I there a way to purge events in Event Viewer? ...

Timer form event
I would like to trigger this event once a day at the same time. Any suggestions. Thanks, Stanley ...

Event 1022 & 9548 in the application log/event viewer
I am getting these to errors in the event viewer, I've read and found that normally this points to a specific user and the fix is to grant associated external account rights to the 'self' user in advanced properties but if look at my errors they aren't pointint to a specific user, they are pointing to the system mailbox see below: Event ID 1022: Logon Failure on database "First Storage Group\Mailbox Store (EXCHMN)" - Windows 2000 account NT AUTHORITY\SYSTEM; mailbox /O=PMC/OU=PMC/cn=Recipients/cn=SystemMailbox{1BB37B17-F026-40C5-9F92-908BEBF38795}. Error: -2147...

Event time off by an hour
I know this issue has been brought up before but some of our users are still encoutering it. When a meeting is created and others invited, the time they get when they accept the request is an hour earlier than the original time. We have set the outlook time to match the system time and time zone and day light savings is enabled both in the control panel and the Outlook calendar time. We also made sure the system time matches the system bios time. All users are in the same time zone. Is there anything else I need to be looking for? This is a very serious situation as we have a lot ...

Event Id: 45 & 49 FTDisk logged in event view after boot up
I get these 2 errors after boot up Event ID: Source FTdisk The system could not sucessfully load the crash dump driver. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Event ID:49 IDSource FTdisk Configuring the Page file for crash dump failed. Make sure there is a page file on the boot partition and that is large enough to contain all physical memory. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. i changed the virusal memory to system managed & no dice, i tried to...

Exchange Event Service will not start
I am running Windows Small Business Server 2003 with Exchange Server 2003 and when I try to start the Exchange Event Service, I get immediately get a message that says "The Microsoft Exchange Event service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service." and when I check my Application event log I have an error event id 5 from MSExchangeES that reads "An unexpected MAPI error occurred. Error returned was [0x80040154]." Anybody have any ideas? I can'...

DblClick Event
I'm new to Access, what am I doing wrong passing these variables to the mainform? I need these pasted or set to the control value in the mainform. Any help would be appreciated. Thanks Private Sub Recording_DblClick(Cancel As Integer) Dim rstInst As Recordset Dim strRecording As String Dim strInstDate As String 'Set recordset to Inst table Set rstInst = dbsCurrent.OpenRecordset("Inst", dbOpenSnapshot) ' Get Recording from subform and set to varible strRecording = Forms!Ownership![Inst Subform].Form![Recording] ' Get InstDate from subform and set to varible strIns...

Event Log Queries
Ok, so I'm working on querying multiple DC's to look for a specific event ID (645 in the security logs, for computers recently joined to the domain). I thought I had everything figured out, but it's still not working right. Running the script, it just somewhat hangs...not sure if that's just because it's still searching or not and is slow. Let me know if you guys have any thoughts...thanks! Dim objDictionary Set objDictionary = CreateObject("Scripting.Dictionary") arrComputers = Array("DC02", "DC03") iReach = 0 For Each st...

Events, dear boy, events
Hi I seem to be having problems with worksheet-level events. I'm pasting: Private Sub Worksheet_Deactivate() MsgBox "Hi!" End Sub Into the sheet-level code sheet. The code isn't triggering when I leav the sheet. Any setting I might be missing? Cheers, Gromi -- Gromi ----------------------------------------------------------------------- Gromit's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=92 View this thread: http://www.excelforum.com/showthread.php?threadid=27721 Did you put it in the correct sheet module? Application.EnableEvents ...

cancel event if data change
Hi there, I have a main form with a sub-form and code at the before update event on the date field under the main form, I would like to bypass/cancel the before update event if the user change the date after entry. I mean that when the user enter the date (new record), the before update event wil be executed. If the user change the date (immediately or after record saved), I would lite to bypass/cancel the before update event. Hope this clear for you. Appreciate for your expert comments. Thanks in advance! On Nov 29, 8:06 am, Andy <A...@discussions.microsoft.com> wrote: > Hi th...

Recurring events #2
I want to put my shift pattern on the Calendar, but it repeats on a five week pattern. Is there anyway I can do this on Outlook? Thanks Ryan ...

toolstrip
I have been using VB9 express and have not been pleased with the behavior of the tooltips for toolstrip items. the tooltip sometimes gets 'stuck' onto the screen over other controls, painted over the top of them until a repaint event of that control can clear it off. rather than find a way to not have this happen, I chose to make my own 'tooltip' of sorts using a separate toolstrip and a label that appears at the bottom of the form on the mouseover event for all my toolstripitems. it works snazzy and looks good except for the toolstripitems that are disabled. I ...

Event ID: 8231 and 8213 in exchange 2003 #2
Hello, running into multiple event errors on server always recurring the same 2, Every 5 minutes i get 3-4 new events with ID 8231; Event Type: Error Event Source: MSExchangeAL Event Category: Service Controller Event ID: 8231 Computer: RootServer Description: Permanent failure reported by policy group provider for 'CN=Recipient Policies,CN=Exchange_Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=DOMAIN-A,DC=com':'MAD.EXE', error=80040103. Taking provider offline. Every 25 minutes i get 1 new event with ID 8213; Event Type: Error Event Source: MSExchangeF...

Add event to menu item
How do I add an event to the click of a menu item? I've looked on Google but couldn't find what I'm looking for (probably too simple a question). http://www.codeproject.com/menu/MenusForBeginners.asp -- Regards, Nish [VC++ MVP] "Si" <si@hotmail.com> wrote in message news:WnR9f.25742$6i4.18667@newsfe7-gui.ntli.net... > How do I add an event to the click of a menu item? I've looked on Google > but couldn't find what I'm looking for (probably too simple a question). > Hi, In VC6, call ClassWizard, find the menu item's id and in ...

Microsoft Dynamics CRM Events in New York and Boston on March 23rd and 25th.
If your an ISV or simply wanting to learn about building CRM applications on the Dynamics CRM platform please sign up in the next day or so. Great opportunity to network with other organizations looking at Dynamics CRM Imagine a development system that could give you the ability to rapidly build line of business solutions, perhaps saving up to 70 percent of your development time. Would that be of interest to you? Imagine the same system already coming pre-built with the capability to be multi-tenant and multi-lingual. Would that save your development team some coding hours? How about a...

Custom Control and the Kill Focus Event
I've got a custom control that I am implementing that behaves much like a combo box. When the user clicks the down arrow button, an new window is displayed that presents a Color Selector much like the one in MS Office. Now I've got everything working fine but one that that is causing me trouble is that when the Color selection drop down is shown the control gets a killfocus message. I don't really want a kill focus message to go out since my control hasn't really lost focus, its just given it to is dropdown window. Looking at SPY I see that the normal combo box doesn't ...

We are here for all your events!
Attention! Need an excellent event management for your business and home we must do events on your behalf with attractive Fees! Contact us :-) Rtlx Groups 61 PNS Gold Mahal, South Avani Moola Street, Madurai - 625 001, Ph No. 0452-4230735, MBL 9597766651/52 Website: www.rtlxgroups.com Email ID: rtlxgroups@gmail.com moorthy@rtlxgroups.com ...

Event Log
It is not enough to read all the unique 'Source' property of event entries since some logs may have sources against which not entries have been made. The list I am after is found here: Administrative tools ! Event Viewer Select any of the log names listed (eg System), then right click & select Properties; on the dialogue that appears, select the Filter tab and drop down the Event Source combo box to see the sources defined. ...

Question concerning DblClick & DoCmd.OpenForm functions in Access
I am running into a problem when trying to open a form by double-clicking on a combo-box within Access. I have a form named “Applications” that has (among other objects) a combo-box named “Support_Goup_Name” that links to a field called “Support_Goup_Name” within table called “Support_Groups”. I also have a separate form named “Support_Groups” that displays a combo-box named “Support_Goup_Name”. The Applications form is used to add applications and support groups to a given system, and I need to be able to choose either from an existing support group (this works now), or add a new su...

Lots of application event log entries... is this normal?
I need a bit of help making some sense out of my event log. Hopefully someone can lend a hand. Sorry if this is long. I have an Exchange Server 2003 recently set up and servicing a 50-user company. I was browsing the application even log and I am getting regular and frequent (several every minute, to every few minutes) warnings and one particular error. I believe that most of these are related. BTW the system is performing just fine, I am just uneasy with the presence of all of those warnings . Here are the symptoms I have observed are: Error/Event ID: 7004 - no help from Micros...

Event ID 3018
I am trying to figure out how to stop this message from showing up in the event logs. Logging is set to none and registry entries are set to 0. Any help would be greatly appreciated. Thank you, Jason Sevier ============================================================= EVENT # : 911469 EVENTLOG : Application EVENT TYPE : ERROR SOURCE : MSExchangeTransport CATEGORY : NDR EVENT ID : 3018 COMPUTER : TIME : 8/10/2004 11:24:02 AM MESSAGE : A non-delivery report with a status code of 5.4.0 was generated for recipient rfc822;Jwhitewood@aol.co (Message-ID <9157...