Conversion to Access Project- currentdb

Hi,

How is everyone today?

I am in the process of converting an Access database to an 
Access Project. The data sits in a SQL server database 
while reports/queries/forms remain in Access. 

I had:

Option Compare Database
Option Explicit
Public Sub Command20_Click()
Dim db As Database

Set db = CurrentDb()

but changed this to:

Option Compare Database
Option Explicit
Public Sub Command20_Click()

Dim db As ADODB.Connection 

Set db = CurrentProject.Connection


which works ok.

Now later in the code I have:


Private Sub Command1_Click()

Dim db As ADODB.Connection


which gives me the following error:

'Compile error: User-defined type not defined'

I am not sure why this is happening, any suggestions?
0
blinton25
2/6/2004 7:20:15 AM
access.conversion 3037 articles. 0 followers. Follow

4 Replies
847 Views

Similar Articles

[PageSpeed] 2

You sure you didn't mistype it the second time?

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



"blinton25" <blinton25@hotmail.com> wrote in message
news:b81c01c3ec81$aaed4a80$a401280a@phx.gbl...
> Hi,
>
> How is everyone today?
>
> I am in the process of converting an Access database to an
> Access Project. The data sits in a SQL server database
> while reports/queries/forms remain in Access.
>
> I had:
>
> Option Compare Database
> Option Explicit
> Public Sub Command20_Click()
> Dim db As Database
>
> Set db = CurrentDb()
>
> but changed this to:
>
> Option Compare Database
> Option Explicit
> Public Sub Command20_Click()
>
> Dim db As ADODB.Connection
>
> Set db = CurrentProject.Connection
>
>
> which works ok.
>
> Now later in the code I have:
>
>
> Private Sub Command1_Click()
>
> Dim db As ADODB.Connection
>
>
> which gives me the following error:
>
> 'Compile error: User-defined type not defined'
>
> I am not sure why this is happening, any suggestions?


0
Douglas
2/7/2004 11:46:13 AM
Hi,

I had tried a copy and paste and still got the same error.

>-----Original Message-----
>You sure you didn't mistype it the second time?
>
>-- 
>Doug Steele, Microsoft Access MVP
>http://I.Am/DougSteele
>(No private e-mails, please)
>
>
>
>"blinton25" <blinton25@hotmail.com> wrote in message
>news:b81c01c3ec81$aaed4a80$a401280a@phx.gbl...
>> Hi,
>>
>> How is everyone today?
>>
>> I am in the process of converting an Access database to 
an
>> Access Project. The data sits in a SQL server database
>> while reports/queries/forms remain in Access.
>>
>> I had:
>>
>> Option Compare Database
>> Option Explicit
>> Public Sub Command20_Click()
>> Dim db As Database
>>
>> Set db = CurrentDb()
>>
>> but changed this to:
>>
>> Option Compare Database
>> Option Explicit
>> Public Sub Command20_Click()
>>
>> Dim db As ADODB.Connection
>>
>> Set db = CurrentProject.Connection
>>
>>
>> which works ok.
>>
>> Now later in the code I have:
>>
>>
>> Private Sub Command1_Click()
>>
>> Dim db As ADODB.Connection
>>
>>
>> which gives me the following error:
>>
>> 'Compile error: User-defined type not defined'
>>
>> I am not sure why this is happening, any suggestions?
>
>
>.
>
0
blinton25
2/8/2004 3:52:48 AM
The only thing I can think of is to try doing a Compile on your project to
see whether there's some other error that's causing Access to behave this
way. With any code module open, Compile is the top option on the Debug menu.

You might also check that you haven't got a problem with your references.
Again, with any code module open, select Tools | References from the menu
bar and examine all of the selected references, looking for any that have
"MISSING:" in front of them.


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



"blinton25" <blinton25@hotmail.com> wrote in message
news:c10201c3edf7$04b40ec0$a301280a@phx.gbl...
> Hi,
>
> I had tried a copy and paste and still got the same error.
>
> >-----Original Message-----
> >You sure you didn't mistype it the second time?
> >
> >-- 
> >Doug Steele, Microsoft Access MVP
> >http://I.Am/DougSteele
> >(No private e-mails, please)
> >
> >
> >
> >"blinton25" <blinton25@hotmail.com> wrote in message
> >news:b81c01c3ec81$aaed4a80$a401280a@phx.gbl...
> >> Hi,
> >>
> >> How is everyone today?
> >>
> >> I am in the process of converting an Access database to
> an
> >> Access Project. The data sits in a SQL server database
> >> while reports/queries/forms remain in Access.
> >>
> >> I had:
> >>
> >> Option Compare Database
> >> Option Explicit
> >> Public Sub Command20_Click()
> >> Dim db As Database
> >>
> >> Set db = CurrentDb()
> >>
> >> but changed this to:
> >>
> >> Option Compare Database
> >> Option Explicit
> >> Public Sub Command20_Click()
> >>
> >> Dim db As ADODB.Connection
> >>
> >> Set db = CurrentProject.Connection
> >>
> >>
> >> which works ok.
> >>
> >> Now later in the code I have:
> >>
> >>
> >> Private Sub Command1_Click()
> >>
> >> Dim db As ADODB.Connection
> >>
> >>
> >> which gives me the following error:
> >>
> >> 'Compile error: User-defined type not defined'
> >>
> >> I am not sure why this is happening, any suggestions?
> >
> >
> >.
> >


0
Douglas
2/8/2004 12:24:54 PM
Hi,

Thanks for the suggestions, will try and let you know what 
happens

>-----Original Message-----
>The only thing I can think of is to try doing a Compile 
on your project to
>see whether there's some other error that's causing 
Access to behave this
>way. With any code module open, Compile is the top option 
on the Debug menu.
>
>You might also check that you haven't got a problem with 
your references.
>Again, with any code module open, select Tools | 
References from the menu
>bar and examine all of the selected references, looking 
for any that have
>"MISSING:" in front of them.
>
>
>-- 
>Doug Steele, Microsoft Access MVP
>http://I.Am/DougSteele
>(No private e-mails, please)
>
>
>
>"blinton25" <blinton25@hotmail.com> wrote in message
>news:c10201c3edf7$04b40ec0$a301280a@phx.gbl...
>> Hi,
>>
>> I had tried a copy and paste and still got the same 
error.
>>
>> >-----Original Message-----
>> >You sure you didn't mistype it the second time?
>> >
>> >-- 
>> >Doug Steele, Microsoft Access MVP
>> >http://I.Am/DougSteele
>> >(No private e-mails, please)
>> >
>> >
>> >
>> >"blinton25" <blinton25@hotmail.com> wrote in message
>> >news:b81c01c3ec81$aaed4a80$a401280a@phx.gbl...
>> >> Hi,
>> >>
>> >> How is everyone today?
>> >>
>> >> I am in the process of converting an Access database 
to
>> an
>> >> Access Project. The data sits in a SQL server 
database
>> >> while reports/queries/forms remain in Access.
>> >>
>> >> I had:
>> >>
>> >> Option Compare Database
>> >> Option Explicit
>> >> Public Sub Command20_Click()
>> >> Dim db As Database
>> >>
>> >> Set db = CurrentDb()
>> >>
>> >> but changed this to:
>> >>
>> >> Option Compare Database
>> >> Option Explicit
>> >> Public Sub Command20_Click()
>> >>
>> >> Dim db As ADODB.Connection
>> >>
>> >> Set db = CurrentProject.Connection
>> >>
>> >>
>> >> which works ok.
>> >>
>> >> Now later in the code I have:
>> >>
>> >>
>> >> Private Sub Command1_Click()
>> >>
>> >> Dim db As ADODB.Connection
>> >>
>> >>
>> >> which gives me the following error:
>> >>
>> >> 'Compile error: User-defined type not defined'
>> >>
>> >> I am not sure why this is happening, any suggestions?
>> >
>> >
>> >.
>> >
>
>
>.
>
0
blinton25
2/20/2004 10:16:32 PM
Reply:

Similar Artilces:

Access violation problem
hi frds i want to resize my editbox at run time .but at line no 6 it is not returning the control pointer and run time it is giving access violation ... plz see my code where i have done mistake .. i will appreciate void CCFileDemoDlg::OnSize(UINT nType, int cx, int cy) { 1CDialog::OnSize(nType, cx, cy); 2HWND* HWnd; // TODO: Add your message handler code here 3 CRect l_formRect; GetClientRect(&l_formRect); CEdit *pEditCtrl; 6 pEditCtrl=(CEdit*)GetDlgItem(IDC_EDIT2); GetDlgItem(IDC_EDIT2); long newWidthEdit = l_formRect.Width()/4; i...

Microsoft Access 2007 Disable Customize Quick Access Toolbar
Need urgent help!!! My previous database was version 2000. After I converted into version 2007, I found that my customize menu is parked under "Add-ins". And, before that I have disable the right click option so that users cannot make changes to the customize menu. But in 2007, apprecaite someone can assist how can I disable the default "Customize Quick Access Toolbar" when user right click at the top menu bar. Many thanks. regards, sam <samhck2@gmail.com> schrieb im Newsbeitrag news:3fbbe1eb-77d3-4f52-bb6b-4e72e9fdec8d@v67g2000hse.googlegroups.com... > Need u...

Using QueryDefs to Build a Dynamic Query in Access
I am trying to build a dialog box that will generate a list of companies based on certain criteria. I have two queries now, one that lists all companies and one that excludes companies that are exhibiting in the current show or have told us they're not going to exhibit in the current show (the latter list is mostly used to try to get companies to exhibit in the show). Here's where it gets complicated. I have three different ways you can filter the data and two sets of fields to choose from. The filters are based on all companies, selecting companies in a specific cate...

Removing Link to Access Query
Hi, I have a merge that I'm doing in Word. My data source is an excel spreadsheet that I oginally tried to link as a table in Access and do a query. However, I changed my mind and would rather use Word. I deleted the Access database and started over. Now, when I open the Word main file and choose Mail Merge Recipients on the toolbar, I choose may data source, but then it says that an Access Query has been detected on the system do I want to use it. I say no and get a table with the list, but when I click edit, I can not edit the list. How can I complete disconnect this data so...

access screens
I want to setup access that will have 'screens' where users can enter car loan application information. I want this information to be saved in access once the save button has been hit. I want this data to connect to a .net WCF server and/or a service broker application that is hosted on a sql server 2005 database. Can you tell me if this feature is available in access? Would this be like a 'hyperlink'? If this feature is available in access, can you tell me how to accomplish this task? Also if this kind of a feature is available, can I email an access database that...

Accessing Picklist Values from Report
I am wondering if it is possible to (and if so, how) to access all possible values in a picklist attribute for a report. Obviously if I'm looking at any given object I see only the value with is currenlty selected for the picklist. But all the values for that picklist attribute have to be SOMEWHERE in a database table right? If anyone can send me in the right direction I would appreciate it. Debra You can use MetadataWebservice to get the picklist values. Sample code ========= EntityMetadata accmd = MetadataService.RetrieveEntityMetadata("account",EntityFlags...

What rights to assign to gain login (user access error after incidentally removing some AD rights)
Hi, in our demo environment, one of the demo users in MSCRM (sales, "central region") somehow has been a little bit "crippled" in AD, but not disabled. Nor has it been disabled in CRM. I reassigned all rights in AD, taking one of the other users ("western region") as an example. In MSCRM, the user still looks fine and has never been deactivated. I still get a "user access error" when logging into CRM (online). 1. What are the crucial points/rights to gain access in CRM? 2. If I delete the user and create one (even with same name), all existing tasks/ob...

DAO and conversion
Hi, Does anyone have experience with converting a Jet Database 2000 version to 2002-2003? I have a VB 6.0 program that's using the Jet database by DAO. You don't need to convert anything. Access 2003/2002 can read a version 2000 just fine (in fact it's the default format in those versions). -- Joan Wild Microsoft Access MVP Martin wrote: > Hi, > > Does anyone have experience with converting a Jet Database 2000 > version to 2002-2003? > I have a VB 6.0 program that's using the Jet database by DAO. The data file for Access 2003 is a Jet 4.0 file, exa...

Access 2003 Running Sum Question
I have a report and sub-report that have running sums, one calculating Material In, the other calculating Material Out. I added a text box to calculate the inventory on hand (=Material In - Material Out). It works, but it pulls the first running sum calculation, not the last. It looks somewhat like below. Is there a way to get the Mat'l. Out Running sum to pull the latest amount by date or something? Any help is greatly appreciated. THANKS!!!! Material In 4/4/10 250 ft Running Sum Mat'l. In 250 ft ...

Access 2007 slow in multi-user environment
I have split the Access 2007 application into FE and BE. FE is on user's desktops (not a shortcut), BE is on the network. Users are using XP, not Vista. Opening the first FE is very fast. Opening the FE on a second machine takes several seconds, displaying a blank screen. Opening the FE on a third machine takes minutes, displaying a blank screen. I'm not sure why the performance is so poor. I would appreciate any guidance. Thanks Bill "BillE" <belgie@datamti.com> wrote: >I have split the Access 2007 application into FE and BE. >FE is on user's deskto...

Script to allow Full Mailbox Access
Hi! I'm trying to figure out how to make a script that will allow me to grant a user "Full Mailbox Access" permissions on a number of user objects in AD. I thought I might be able to use dsacls for this task but I can't figure out if it's possible and what the syntax is for granting this specific permission. Does anyone know whether this is possible? Thanks in advance Morten Morten: Exchange / AD does not currently do this, though I suspect the ability will be in Exchange 12. In the meantime, take a look at ADModify.NET. http://www.gotdotnet.com/workspa...

Install Access 07 when Office 03 installed?
HI - I cannot find a place on the MS site to ask this question, so I am desperately asking it here. My apologies to this board. I have Office SB 03 on Win XP sp 2. Can I purcahse Access 07 and installl it successfully AND continue to use the Office 03 prodcuts successfully. I don't want any problems with the products conflicting. I need Office to work! Where do I ask this question? Thank you very much in advance. Differring versions of both Office & their components can usually be installed without problems, excepting outlook The only problem is usually with shorcuts, or ...

32-bit to 64-bit conversion
Hi, I need to convert a 32-bit application to 64-bit. The 32-bit one is created in VC++ 6.0. Now I need to convert it using VC++ 2005. Can someone point me a good source of info about conversion, e.g. what to change and important processes involved. Any guide or suggestion will be appreciated. Thank you for your time. Tony Mostly the problems arise when you have made an assumption that xxxx and void * are interchangeable where xxxx is any integer type such as DWORD, int, long, UINT, etc. If you have ever misused prototypes, for example, instead of using WPARAM you used UINT or LPA...

Quicken 2004 to Money 2004 Conversion???
Is there any way to convert a Quicken 2004 file to a Money 2004 File? During the conversion Money creates the accounts, but every transaction is 0.00 and all account balances are 0.00. See http://umpmfaq.info/faqdb.php?q=30 Basically M2004 can only convert Q2003 and earlier. Wait a month or two and M2005 should arrive which ought to be able to handle Q2004. -- Regards Bob Peel, Microsoft MVP - Money For UK tips & fixes see http://support.microsoft.com/default.aspx?scid=fh;EN-GB;mny. For wishes or suggestions see http://register.microsoft.com/mswish/suggestion.asp or for UK wishe...

Sizing Access 2007 Forms
I'm wondering if I'm the only one having problems saving the size of access 2007 overlapping forms. I decided to play around with a copy of my db and changed it from a tabbed to overlapping interface. I posted a question about this some time ago and the following is a response that I had saved to a text file: ----------- 'The forms border should be set to sizeable. You then while viewing the form in regular view mode then set the size exactly the way you want. You then hit ctrl-s. I also assumed that in design mode you shrunk down the detail size to as small as possi...

how do I access office xp media/clip art in publisher 2003
installed office system 2003 all editions and can not access clip art or office xp media files. Not sure what to do. Any suggestions? If you have the media disk from Office XP, insert it and run it, the Organizer has its own setup. Run all from my computer. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "griffin" <griffin@discussions.microsoft.com> wrote in message news:4BEB65A1-27A6-493D-8346-6ADD620C8BE7@microsoft.com... > installed office system 2003 all editions and can not access clip art or > office xp ...

Access: display a different subform depending on another field?
I'm creating a form in Access, and I have a tab control in it. Under one of the tabs, I want to display a subform, but not always the same one. I have 5 different subforms created and I want to display a particular one based on the choice the user makes in a field further up the form. Is that possible? artemi wrote: >I'm creating a form in Access, and I have a tab control in it. Under one of >the tabs, I want to display a subform, but not always the same one. > >I have 5 different subforms created and I want to display a particular one >based on the choice the...

Conversion in EXCEL Numeric to Text
Hi, I'am looking for VBA program inside EXCEL, which can convert numeric cells to text. Thank you Arnold You could try this formula: =TEXT(A1,"000000") This will convert the number in A1 to a 6-digit text value, with leading zeros as necessary. Hope this helps. Pete On Jan 29, 10:35 am, "News" <arn...@normdesk.nl> wrote: > Hi, > > I'am looking for VBA program inside EXCEL, which can convert numeric cells > to text. > > Thank you > > Arnold Or need you mean: 44 to forty-four? Is so then see http://www.xldynamic.com/sourc...

loss of access to records after update
I found that particularly in relation to using an afterupdate event on a combo that was to select the records one by one. It would only select the record the first time after the form was activated(?) I am not sure but I think this behaviour is dependent on a version of Access 2000. When I used Access 2002 it might have been corrected. ...

VC++ 6 to .NET Conversion problem!
hi ppl, I want to convert a projet that i created in VC++ 6 to .NET. I just used the automatic option when i opened the project file in VC.NET.However when i compile the project im getting an error which never used to happen in VC++ 6 version. Can someone help me out with this. Ive broken my head on it with no results.The place where the error is happenin and the type of error is given below. class CFin { public: CFin(void); ~CFin(void); //the function call that generates an error in VC.NET double funk(vector<double> x); int getNoOfDim(void){ return NoOfDim;}; int getNoOfVert(vo...

2007 PS Project Import
Hello, I am trying to import projects from a 2003PS 2003 to PS 2007 and keep actuals per completed and started tasks. My approach is to save the files locally as .mpp files then open and resave in Project Pro 2007 (locally). Then open up Project Pro, connect to the 2007 server and run the project import via tools/enterprise options/import project to enterprise When going through the project import wizard I am running into an error for some of the resources. For 5 of th 25 resources on the project , the wizard will not "validate" and says "resource nt account...

TAb forms in Access 2007
I am new to using Access 2007 and I would like to be able to split a large table across many forms using tabs as a way of doing it - like a normal filing system. E.g. tab for name, then contact details, training information, etc. I would be extremely grateful if someone could help me out, as I do not see a method in 2007. Barry, With you form open in design view, click on the Design Tab in the ribbon. One of the control selection buttons looks like a tab control. It should be on the right of the Check mark, but the tool tip will tell you. Click on it then click on your form. To...

Message of Program trying to access address book
I'm getting frequent messages of the following nature on my Outlook. It repeatedly appears, and then Outlook freezes and I have shut it down. "A program is trying to access your Address Book. A program is trying to access your Address Book or contacts. Viruses can spread by sending copies of e-mail messages to people listed in your Address Book. You must allow or deny access to your Address Book before this program can continue." I'm not sure if it's a virus or some glitch that can be repaired. Can anyone help? See if the information on the following page hel...

A Program Is Trying To Access Outlook e-mail Address...
Hi - Whenever I try to send an email message using Word or any other program, I get an Outlook message informing me that "a program is trying to access e-mail addresses you have stored in Outlook". The only choices I get are to allow access for one instance or for a short period of time. What I want to do is to ALWAYS allow Word, PowerPoint, Excel and ACT to access my Outlook e-mail addresses. How can I do this? Thanks for your help John ARe you using Adobe Acrobat 6.0 full version - not the free reader? If yes, then you need to disable the Acrobat .dot file - see this p...

owc10.dll version 1.2 error on loading Access 2007
Just updated to Access 2007 on network with 10 users gettign owc error. Normal corrections in Access 2002 etc have not worked John, You didn't mention what are those *normal corrections* were... I would uncheck that reference and compile. See the bottom of the page... http://www.regina-whipp.com/index_files/References.htm -- Gina Whipp 2010 Microsoft MVP (Access) "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "John Cambridge" <John Cambridge@discussions.mic...