473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Object in this control

489 256MB
I've switch my database from 2003 to 2007 and find a problem with a relink module that I've been using. The code I've been using is RelinkCode and what it does is if the database can not be found it allows you to locate the current database and then relink it. Everything worked great when using 2003 but now with 2007 I get "There is no Object in this control" the code that it stops on is
Expand|Select|Wrap|Line Numbers
  1. Public Function Browse()
  2.     ' Prompts user for Cowboy Action database file name
  3.     On Error GoTo Err_Browse
  4.  
  5.     Dim strFileName As String
  6.     Dim oDialog As Object
  7. ** the next line is where the program stops with the error message
  8.    Set oDialog = [Forms]![frmNewDatafile]!xDialog.Object
  9.  
  10.     With oDialog                ' Ask for new file location
  11.         .DialogTitle = "Please Select new SASS Premier Scoring Files"
  12.         .Filter = "Access Database(*.mdb;*.mda;*.mde;*.mdw)|" & _
  13.         "*.mdb; *.mda; *.mde; *.mdw|All(*.*)|*.*"
  14.         .FilterIndex = 1
  15.         .ShowOpen
  16.         If Len(.FileName) > 0 Then  ' user responded, put selection into text box on
  17.             [Forms]![frmNewDatafile]![txtFileName] = .FileName
  18.         End If
  19.     End With
  20.  
  21. Exit_Browse:
  22.     Exit Function
Hopefully someone can make sense out of this and be able to point me the correct direction.

Thanks for any help as always this is the best place to find answers.
Oct 30 '09 #1
10 2565
NeoPa
32,556 Expert Mod 16PB
This is all about the xDialog control on your frmNewDatafile form.

Unfortunately we cannot know what type of control that is (until you tell us of course). Your code is expecting a control which contains an .Object property. This is not something that I'm familiar with. None of the standard controls do as far as I'm aware. It's probably some form of specialist control, in which case we would need to know about it before we can be much help.

It may be that there is a Reference missing of course. That's always worth checking first for a problem like this. Check in Tools \ References of the IDE (Alt-F11) to see if any are flagged as Missing.
Oct 31 '09 #2
CD Tom
489 256MB
Thanks for the reply. I have no idea what the xDialog.object is. I'm using this code from something I got off one of these forums. Now I should also mention that I'm running this on Windows 7 but I don't think that has anything to do with the problem. The message comes up with I bring up the form and also when I click on the button that should allow me to browse for the database I'm looking for.
What usually happens is when I click on the button if brings up the standard windows browse and allows me to select the database it then places it in a text box called txtFileName I then need to click on another button that will relink all the files in the database to the new location.
I've checked the references and have nothing missing.
Any other suggestions?
Thanks again
Oct 31 '09 #3
CD Tom
489 256MB
I just typed the location of the database in the txtFileName field and when I click the relink button everything works. It looks like the browse window isn't working. I'm using another browse function to locate where the user wants to put their backup files. I'm going to try and see it that will work here. I'll get back if I can get it to work. Thanks again for all the help.
Oct 31 '09 #4
CD Tom
489 256MB
Ok here's what I've done and it works to a point.
I'm calling the standard windows open and save module this brings up the standard windows open dialog box, I've set the filter to only bring up *.mdb I then select the file that I wish to use. Here's where I'm now running into problems the file name is located in a var txtFileName but when I return from the module the txtfilename is blank. I've tried setting txtFileName as a Public var but that still doesn't work. How do I get the var from the Module back to the original form.
The button on the original form has on the Click event =browse() I've tried setting code on that event to call Browse but the txtFileName still comes back null.
I need your help again. Thanks
Oct 31 '09 #5
NeoPa
32,556 Expert Mod 16PB
Let me see if I can get this straight :
You call the function Browse() as the OnClick event procedure of your CommandButton?
Where is the var txtFileName defined?
What is var in this context?

I think it may help to see the code you have as Browse() (if it's different from the code in your OP - I expect it should be).
Nov 1 '09 #6
CD Tom
489 256MB
Thanks for the reply hears the Browse code
Expand|Select|Wrap|Line Numbers
  1. Public Function Browse()
  2.  
  3. Dim strFilter As String
  4. Dim strinputfilename As String
  5.  
  6.  
  7. strFilter = ahtAddFilterItem(strFilter, "*be.mdb")
  8. strinputfilename = ahtCommonFileOpenSave( _
  9.                 Filter:=strFilter, OpenFile:=True, _
  10.                 DialogTitle:="Please select an input file...", _
  11.                 Flags:=ahtOFN_HIDEREADONLY)
  12.  
  13. txtFileName = strinputfilename
  14.  
  15. Exit_Browse:
  16.     Exit Function
  17. Err_Browse:
  18.     MsgBox err.Description
  19.     Resume Exit_Browse
  20. End Function
I could use either the strinputfilename or the txtFileName I was trying both but can't get them to show up on the form that calls Browse.

Hope this helps.
Nov 2 '09 #7
CD Tom
489 256MB
There is a form that has two command buttons one to locate the database and the second to relink once the database has been located. The command button the is used to locate the database is the one that calles the browser routine but when I return to the main form the database location isn't there. Like I mentioned the is a text field where I want the location to appear and that field is called txtFileName. If I just type the database location into that field and select the link command button everything works. I just need to get that location from the browse routine to show up in the text field. I hope this makes sense. Thanks again for your help.
Nov 2 '09 #8
NeoPa
32,556 Expert Mod 16PB
Tom,

I'm bemused. Your account is on the verge of being suspended for continuous rule-breaking. I've explained this in exhaustive detail in the series of PMs I've had to send you along with the warning and infraction. In such a situation I'm really surprised that you post code yet again without using the mandatory [ CODE ] tags. I've heard nothing from you explaining that you are having difficulty understanding how to follow the guidelines so I need to understand why this is if I'm to refrain from suspending your account.

I'm quite happy to help you with your technical issues, but this problem will not go away until you do something about it. I hope I'm clear.

Administrator.
Nov 2 '09 #9
NeoPa
32,556 Expert Mod 16PB
Technical answer :
I am struggling here as I asked 3 questions which you have replied to with some more pretty incoherent prose instead of specific answers. This is fine if you like posting backwards and forwards. I'm not greatly fussed. If however, you are interested in getting help from us here, you will need to be more precise and accurate with your responses. I spent the time to work out what information I needed to help you. If you ignore this and repeat an attempt to explain it in your own, quiite imprecise words, then we are back at first base. Your last post contains some typos; some missed out words; some words that simply don't fit in the sentence at all (but are somewhat similar to words that might). All in all it is useless as an attempt to pass the information I need and requested. I know you don't know all the right terms - That's why I posted the questions I did. Sure it means you have to do a little work to find the answers. If that's too much then just let us know and we can all stop wasting our time. If, however, you are sincerely interested in getting help, then I suggest you apply yourself a bit more directly to the issue.

I'll leave this with you.
Nov 2 '09 #10
CD Tom
489 256MB
I have been playing with this all weekend and have finally got it to work. It basically had to do with making the var public so that they are available to any form. I had done this before but for some reason it didn't work then all of a sudden they started working, go figure!!! Thanks for your help
Nov 2 '09 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Pkpatel | last post by:
Hi, I keep getting this error every time I try to load crystalreportviewer on a webform with a dataset. Here is the error: -------------------------------------------------------- Server...
12
by: Sanjay | last post by:
hi, We are currently porting our project from VB6 to VB .NET. Earlier we used to make scale transformations on objects like pictureBox , forms etc.Now Such transformations are made on the...
9
by: Keith Rowe | last post by:
Hello, I am trying to reference a Shockwave Flash Object on a vb code behind page in an ASP.NET project and I receive the following error: Guid should contain 32 digits with 4 dashes...
2
by: Roby Eisenbraun Martins | last post by:
Hi, My name is Roby Eisenbraun Martins, I am a C++, VB and NET developer. I am working with a NET 2002 project right now and I am receiving this uncommon "OutOfMemory" error message when I try...
3
by: roni | last post by:
how can i execute a delegate on the thread that created the object ? (the object is not control, but im looking somthing like the control.invoke , but to my object)
1
by: Martine | last post by:
Hi there! I have a problem with programmatically adding user controls to my mobile webforms. If I load my usercontrol programmatically (in the Page_Load), the object is instantiated, I have...
9
by: Moe Sizlak | last post by:
Hi There, I am trying to write the selected value of a listcontrol when a button is clicked and I keep getting the error "object not set to a reference of an object". The libox itself is in a...
6
by: blash | last post by:
Can someone help me? I really don't have a clue. My company staff told me they often got such error: "Object reference not set to an instance of an object." when they are in search result page...
15
by: Hamed | last post by:
Have I posted the message to wrong newsgroup? Or Does the question is so much strage? Would someone please kindly direct me to a true newsgroup or resource? Best Regards Hamed
0
by: Tamer Ibrahim | last post by:
Hi, Sometimes, I got the following error message when I use ajax calendar control on some aspx pages : Object reference not set to an instance of an object. Description: An unhandled exception...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.