Object dosent support this property or method

This code behind a command button should check to see if a record exists and 
open a form with that data if it does. If record does not exist it will open 
the form in data entry mode.

I don't understand this error???


Private Sub cmdMember_Click()
On Error GoTo Err_cmdMember_Click

    Dim stDocName As String
    Dim stLinkCriteria As String
    Dim dbcurrent As DAO.Database
    Dim rstemp As DAO.Recordset
    
    If IsNull([cmdMember]) Then
        MsgBox "Please enter a Member # before proceeding."
        Exit Sub
    Else
        'Check to see if a record already exists
        Set dbcurrent = CurrentDb
        Set rstemp = CurrentDb.OpenRecordset("select * from [tblMemberInfo] 
where [MemberNo] = " & "'" & Me.[cmdMember] & "'" & ";")
        stDocName = "f_MemberSub"
        
        If rstemp.RecordCount > 0 Then          'Open Record
            stLinkCriteria = "[MemberNo]=" & "'" & Me.[cmdMember] & "'"
            DoCmd.OpenForm stDocName, , , stLinkCriteria
        Else                                    'Create a new record
            DoCmd.OpenForm stDocName, , , stLinkCriteria
            Forms!f_MemberSub.DataEntry = True
        End If
        Forms!f_MemberSub.MemberNo = Me.cmdMember
    End If

Exit_cmdMember_Click:
    Exit Sub

Err_cmdMember_Click:
    MsgBox Err.Description
    Resume Exit_cmdMember_Click
    
End Sub
0
Utf
10/23/2007 1:54:00 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
1039 Views

Similar Articles

[PageSpeed] 55

Assuming that MemberNo is the name of a control on the form, try

Forms!f_MemberSub!MemberNo

If that still doesn't work, try renaming the control (but don't change its 
ControlSource!)

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Dan @BCBS" <DanBCBS@discussions.microsoft.com> wrote in message 
news:36E7FECC-43F7-45DE-98FB-3872370EAFC5@microsoft.com...
> This code behind a command button should check to see if a record exists 
> and
> open a form with that data if it does. If record does not exist it will 
> open
> the form in data entry mode.
>
> I don't understand this error???
>
>
> Private Sub cmdMember_Click()
> On Error GoTo Err_cmdMember_Click
>
>    Dim stDocName As String
>    Dim stLinkCriteria As String
>    Dim dbcurrent As DAO.Database
>    Dim rstemp As DAO.Recordset
>
>    If IsNull([cmdMember]) Then
>        MsgBox "Please enter a Member # before proceeding."
>        Exit Sub
>    Else
>        'Check to see if a record already exists
>        Set dbcurrent = CurrentDb
>        Set rstemp = CurrentDb.OpenRecordset("select * from [tblMemberInfo]
> where [MemberNo] = " & "'" & Me.[cmdMember] & "'" & ";")
>        stDocName = "f_MemberSub"
>
>        If rstemp.RecordCount > 0 Then          'Open Record
>            stLinkCriteria = "[MemberNo]=" & "'" & Me.[cmdMember] & "'"
>            DoCmd.OpenForm stDocName, , , stLinkCriteria
>        Else                                    'Create a new record
>            DoCmd.OpenForm stDocName, , , stLinkCriteria
>            Forms!f_MemberSub.DataEntry = True
>        End If
>        Forms!f_MemberSub.MemberNo = Me.cmdMember
>    End If
>
> Exit_cmdMember_Click:
>    Exit Sub
>
> Err_cmdMember_Click:
>    MsgBox Err.Description
>    Resume Exit_cmdMember_Click
>
> End Sub 


0
Douglas
10/23/2007 2:07:38 PM
Thanks
I renamed the control and noticed it was wrong in another area.

It's working now!!!



"Douglas J. Steele" wrote:

> Assuming that MemberNo is the name of a control on the form, try
> 
> Forms!f_MemberSub!MemberNo
> 
> If that still doesn't work, try renaming the control (but don't change its 
> ControlSource!)
> 
> -- 
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
> 
> 
> "Dan @BCBS" <DanBCBS@discussions.microsoft.com> wrote in message 
> news:36E7FECC-43F7-45DE-98FB-3872370EAFC5@microsoft.com...
> > This code behind a command button should check to see if a record exists 
> > and
> > open a form with that data if it does. If record does not exist it will 
> > open
> > the form in data entry mode.
> >
> > I don't understand this error???
> >
> >
> > Private Sub cmdMember_Click()
> > On Error GoTo Err_cmdMember_Click
> >
> >    Dim stDocName As String
> >    Dim stLinkCriteria As String
> >    Dim dbcurrent As DAO.Database
> >    Dim rstemp As DAO.Recordset
> >
> >    If IsNull([cmdMember]) Then
> >        MsgBox "Please enter a Member # before proceeding."
> >        Exit Sub
> >    Else
> >        'Check to see if a record already exists
> >        Set dbcurrent = CurrentDb
> >        Set rstemp = CurrentDb.OpenRecordset("select * from [tblMemberInfo]
> > where [MemberNo] = " & "'" & Me.[cmdMember] & "'" & ";")
> >        stDocName = "f_MemberSub"
> >
> >        If rstemp.RecordCount > 0 Then          'Open Record
> >            stLinkCriteria = "[MemberNo]=" & "'" & Me.[cmdMember] & "'"
> >            DoCmd.OpenForm stDocName, , , stLinkCriteria
> >        Else                                    'Create a new record
> >            DoCmd.OpenForm stDocName, , , stLinkCriteria
> >            Forms!f_MemberSub.DataEntry = True
> >        End If
> >        Forms!f_MemberSub.MemberNo = Me.cmdMember
> >    End If
> >
> > Exit_cmdMember_Click:
> >    Exit Sub
> >
> > Err_cmdMember_Click:
> >    MsgBox Err.Description
> >    Resume Exit_cmdMember_Click
> >
> > End Sub 
> 
> 
> 
0
Utf
10/23/2007 2:21:00 PM
Reply:

Similar Artilces:

Objects duplicated
If a workbook consists of Objects: Sheet1, Sheet2, This Workbook.... What would cause Excel to duplicate these objects in the same workbook. Somehow, I now have to sets of objects in the same workbook that are exactly the same. ...

Outlook E-mail support for Hotmail
I have Office 2000 and wish to get my hotmail e-mail by using my Outlook 2000 as I already have other e-mail accounst in it. Anyone know how to do this? See here for information: http://www.slipstick.com/config/ol2000hotmail.htm -- Patricia Cardoza Outlook MVP www.cardozasolutions.com Author, Special Edition Using Microsoft Outlook 2003 ***Please post all replies to the newsgroups*** "Guy Martin" <guyjackmartin@comcast.net> wrote in message news:1eca01c3e049$1ac2e300$a401280a@phx.gbl... > I have Office 2000 and wish to get my hotmail e-mail by > using my Outlook...

cannot shift objects off sheet, but also cannot find objects
Trying to hide columns gives error "cannot shift objects off sheet." Try as I might, I cannot find any objects in or near the offending columns; indeed, there are no objects on the entire sheet. I went to Tools>Options>View>Objects and selected "Show All," but still nothing appears. An easier way to see if there are any objects on a sheet is through F5-Special. Cell comments are objects too. Do you have any of them? -- Jim Rech Excel MVP "danielo" <anonymous@discussions.microsoft.com> wrote in message news:0cff01c47b0d$f5a72620$a601280...

How to record which objects a user clicks on
Hi, New to the forums here. I would like to know how to track which objects a user clicks during a powerpoint presentation. I realize this will probably require a macro and that is where I need help. I'm fairly tech savvy, but I don't know how to program in VB. Whenever there is a mouseclick on an object in the slideshow, I would like two things to happen: 1) Advance to a particular slide (which I see can be set easily in the program) 2) Write data, to a separate file (it can be a text file), that reports which object was clicked. This would happen in the background so t...

How do I group objects and Word Art in Publisher?
I am creating a button and have our company logo along with a slogan that I put in Word Art. I would like to group these two items together so it will be easier to move around as one object. I have tried using the "select object" tool and it will not let me group them. It just moves my objects around and not as a group. I don't quite understand. Do you have a border around your page? If so send it to the back and try selecting your logo and WordArt again. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Fal...

Problem With Opening Embedded Object After Turning On "Track Chang
In order to use the routing function, I'm using company forms created in excel. On another tab, I've embedded "as icon objects" any supporting material created in Word. This works great, as recipients can double-click these icon objects and launch the documents in Word to view them. The problem occurs when I decided to add "Track Changes" to the files I am routing. When this is done, the icon objects still appear but can no longer be double-clicked. The online documentation in excel indicateds that you can't insert any embedded objects after "T...

Turn off object theme colors
I have a presentation with a number of objects (mainly simple shapes like circles and squares) that have powerpoint theme colors. I now want to copy and paste them into another Powerpoint that has a different theme. I of course don't want the colors to change. Other than going into each object and changing the color into a customized color, is there any way I can get these objects in using their original color - not tied to the theme? Hi When you paste the objects into the other presentation you'll get a little clipboard in the bottom right hand corner - click on ...

Insert Object File path when attaching OLE Objects
When attaching a note and click on the paper clip, I go to Edit Insert New Object to attach a word document or an excel file. When I select 'Insert New Object' the Insert Object screen opens and I select the Create from File option. The path showing there is the path where GP is installed, in my case - c:\Program Files\Microsoft Dynamics\GP\. Is there a way I can change this default path? Maria, I am afraid this path defaults from the location of your DEX.INI file, which in the case of GP 9, can be found typically under the GP root folder, in the case of GP 10, under the GP...

Item Matrix properties
I have just upgrade our system to 2.0. We have installed Hot Fix 2.0.0107 The problem that we are having is looking at the Properties for an "Item Matrix" RMS seems to lock up and tie the processor up completely. The only way out is to "CTRL ATL DEL" Seems like a bug I am having a simular problem. On level 2.0.0105 I get a not responding message after about 15 min. when trying to look at a matrix with 285 entries. If i try in my test system level 2.0.0108 it takes about 10 min. to bring the matrix up in Manager. This matrix was never a problem in 1.3. Any sugge...

WTL objects dependent on what runtime objects?
If I make and distribute a WTL program, what DLL's (if any) must also be present? I mean, if I make an MFC application, I assume that my installation program is also going to need to make sure that MFC42.dll and maybe a couple of other DLL's is on the target machine and up to date. What is a WTL program dependent upon? *********** Richard Lewis Haggard "Richard Lewis Haggard" <HaggardAtWorldDotStdDotCom> wrote in message news:OBcsU13uDHA.640@tk2msftngp13.phx.gbl... > If I make and distribute a WTL program, what DLL's (if any) must also be > present? I mean...

Excel 2007 crashes after viewing property sheet in Data Connection
I have been using Excel 2007 to import comma delimited text (csv) files stored on my local hard disk into my personal finance spreadsheet. The Data>Get External Data>From Text wizard works fine and have had no trouble using the Refresh function. The problem comes from accessing a Connection Properties Box from the Data>Connections Box. If I select OK after viewing the Properties Box, Excel crashes, restarts, and offers to let me continue working on a repaired worksheet. This behavior occurs even when no changes are made in the Properties Box. If I select Cancel, Excel exits the...

Embed a modeless cdialog derived object into a cformview derived object
I am creating an mfc application and would like to know if this is possible at all (not very experienced with MFC). I have an SDI application with a CFormView derived object. Inside this form I want to embed a CDialog derived modeless dialog which contains controls that I want to reuse throughout the application (a few edit boxes, a couple of buttons). I'm at the point where the CFormView gets displayed, and at this moment I want to embed in it my dialog object. First of all: am I going about this the right way in trying to reuse a dialog? I tried the following code: CSelectOriginType i...

Method=post in OWA
We are running a Windows 2003 domain and Exchange 2003. Some of our users create an HTML based email that has form fields and a "SUBMIT" button the "method=post" works just fine in Outlook 2003. The problem is when a user uses OWA. The "SUBMIT" button doesn't work. When I view the source code in OWA it seems that OWA removes the word "post" leaving just "method=". Anyone know why OWA strips out the word "post"? Thanks for any and all help. Clayton "Clayton Sutton" <none@none.com> wrote: >We are runnin...

Sheet Protection / Edit Objects 12-05-09
I have a spreadsheet with multiple objects that I'm trying to lock. My problem is I also have cells that I need to have comment insertion capabilites. When going to Tools/Protection/Protect Sheet and allow Edit Objects is checked I can insert a comment. However, it also allows the other objects on the sheet to be accessed. Is there a way to allow the Edit Objects option in a specified range of cells and still protect the sheet? Perplexed.... Keyrookie -- Keyrookie You would have to have that range without the checkbox for locked checked: FORMAT CELLS>PR...

Can Excel support active clip-art?
Hi. I'm hoping to use Excel 2002 as a spreadsheet to calculate a formula (nothing unusual there I know) but I would like to jazz it up a bit with some all-singing-all-dancing clip art such as Flash movies or something. Wondering if Excel does that or do I need a web page with a link to the spreadsheet? ...

Static CMap object #2
Hi all, Excuse but the other message is wrong I've declared in my .h file the following CMap type : typedef CMap<CString, CString&, MyClass*, MyClass*&> Map; ... ... class AnotherClass { ... public: static Map BuilderMap; ... ... static void Register(CString name, MyClass* instance); }; In one of my CPP file call the Register method as following: AnotherClass::Register(_T("TEST"), this); The code of Register method is : void AnotherClass::Register(CString name, MyClass* instance) { AnotherClass::BuilderMap.SetAt(name, instance); } When linking my project there t...

Support Now Live Chat Support System
Supportnow Provides 24/7 operators to address such issues. Live human operators assist by assisting online queries. visit www.supportnow.biz ...

Update Index Method in Subform
I have a form with several subforms on it. Because the table relationships are required to be a certain way, I have had to code in a method for synching the records via the form. The code is below: Private Sub Form_Current() Dim Response As Variant On Error Resume Next If IsNull(Me.INVNUM) Then Me.INVNUM = Format(DMax("Left([INVNUM],5)", "HDRPLAT") + 1, "00000") & "A" Response = MsgBox("Is this Invoice Number what you want?", vbOKCancel) If Response = vbCancel Then Me.Undo Exit Sub End If Response = acDataErrC...

All CRM objects have been updated in one weekend. Not sure how.
I noticed that every Lead, Opp, Account and Contact has a Modified On date of this past Saturday or more recently. The records with Saturday's modified date don't show any particular changes, just the Modified On date and the Modified By user. It's more than a trivial issue. There are business reasons for knowing when things are being updated. Some of these Modified By values are disabled, former users. They were the original creators of the objects. CRM is running on its own server. This SQL Server is also running Veritas Backup Exec. did these users create any work...

Chart Object and Worksheet Object
What are the difference? I insert a Excel chart into PPT by Insert>object>create from file>[browse]... It always comes out as a worksheet object whether I get a chart of the data. Whereas, Edit>Paste special method clearly differenciate a chart object from a worksheet object. I know I could convert to either way but any difference? In article <CE92D095-8E17-4AD4-85B9-317AC15A13BF@microsoft.com>, Win wrote: > What are the difference? > > I insert a Excel chart into PPT by Insert>object>create from file>[browse]... As I suggested earlier...

disconnected chart objects
Consider the following: A B 1 15 15 2 25 15 3 25 35 4 15 35 5 15 15 6 7 45 45 8 75 45 9 75 105 10 45 105 11 45 45 In Excel with row 6 present & blank you get two disconnected boxes using XY-scatter format with lines and points. If you remove the empty row 6 you get the boxes plus a line connecting points 15,15 and 45,45. In Open Office Calc (OOC), you get the boxes connected in either case unless you move one of the y sets to column B (creating two series.) Although this is an Excel group, since I haven't been able to get any re...

XmlSerializer and inherited objects
Hi I have a hirachy of classes which are Message(base), then FileMessage and ChatMessage (extended) I want to serialize the objects and when i am deserizaling i dont know if i am getting FileMessage or ChatMessage. So how to get that object and use it I have written following code for serialization public void Send(Message message) { NetworkStream netWorkStream=null; try { XmlSerializer serializer=new XmlSerializer(message.GetType()); netWorkStream=new NetworkStream(_clientSocket); Stream stream=(Stream)netWorkStream; serializer.Serialize(stream,message); } finally { netWorkStrea...

Transfertext Error
Thank you inadvance, Following code gives me an error "Database or object is read only". Your insights are appreciated. Dim MyDate MyDate = Replace(Date, "/", "-") OutPutFile = "\\....\Report " & MyDate & ".xls" DoCmd.TransferText acExportDelim, "MySpecification", "MyFile", OutPutFile, True You're trying to use the TransferText method, but you've got a file extension of .xls, which is Excel. Either use the TransferSpreadsheet method, or change the file extension to one that's appropriate for tex...

My object cannot be sent behind the text
Hi I'm trying to send an object behind the text, the Draw/Order/Send to Back option is available but when I select it tye object is still in front of the text. Any suggestions? ...

WMI Object
This script works on V1, but I am running it from V2. I am trying to automate SCCM collection population using queries (as opposed to direct memebership). A successful running of the script will take a CSV file, pull out PC names, put those into a WQL query format, and then push the query into SCCM through the WMI interface. The class\instance I am trying to connect to is \\<SCCMServer>\root\SMS\Site_<sitecode>:CollectionID="<CollectionID>" When I enumerate this object in wbemtest on the server, I get 2389 objects returned, but when I connect throug...