Need Help Please

I have a subform that when you double click on the lastname it brings up 
another subform.  This works fine, however when I double click on the 
lastname a parameter box appears requesting that the lastname is typed in, 
then press okay.  Below is the code that I am using to accomplish this.  How 
do I get rid of the parameter box? 

Private Sub LastName_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = Me.LastName
stDocName = "frmHours_Worked subform"
DoCmd.OpenForm stDocName, , , "LastName = " & stLinkCriteria

Debug.Print stLinkCriteria

End Sub

Secondly, the subform that appears when you double click on the lastname is 
set for datasheet view, however, when it appears it is in single form view.  
If you click the design key on the toolbar and then back to the form view it 
will appear in datasheet view.  How do I fix it so that the subform opens in 
datasheet view without have to click design then form?

Please help
-- 
tmdrake
0
Utf
12/12/2007 2:34:00 AM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
521 Views

Similar Articles

[PageSpeed] 43

tmdrake wrote:

>I have a subform that when you double click on the lastname it brings up 
>another subform.  This works fine, however when I double click on the 
>lastname a parameter box appears requesting that the lastname is typed in, 
>then press okay.  Below is the code that I am using to accomplish this.  How 
>do I get rid of the parameter box? 
>
>Private Sub LastName_DblClick(Cancel As Integer)
>Dim stDocName As String
>Dim stLinkCriteria As String
>stLinkCriteria = Me.LastName
>stDocName = "frmHours_Worked subform"
>DoCmd.OpenForm stDocName, , , "LastName = " & stLinkCriteria
>
>Debug.Print stLinkCriteria
>
>End Sub
>
>Secondly, the subform that appears when you double click on the lastname is 
>set for datasheet view, however, when it appears it is in single form view.  
>If you click the design key on the toolbar and then back to the form view it 
>will appear in datasheet view.  How do I fix it so that the subform opens in 
>datasheet view without have to click design then form?


Because the Last Name field is type Text, you need to make
sure the criteria value is quoted:

DoCmd.OpenForm stDocName, , , _
									"LastName = """ & stLinkCriteria & """"

Open the form in design view and set the form's DefaultView
property to DataSheet.  Then close and save the form.

Another way is to specify the view on the OpenForm method's
View argument:

DoCmd.OpenForm stDocName, acFormDS, , _
						"LastName = """ & stLinkCriteria & """" _

-- 
Marsh
MVP [MS Access]
0
Marshall
12/12/2007 3:52:24 AM
It worked, Thank You so much!!!!
-- 
tmdrake


"Marshall Barton" wrote:

> tmdrake wrote:
> 
> >I have a subform that when you double click on the lastname it brings up 
> >another subform.  This works fine, however when I double click on the 
> >lastname a parameter box appears requesting that the lastname is typed in, 
> >then press okay.  Below is the code that I am using to accomplish this.  How 
> >do I get rid of the parameter box? 
> >
> >Private Sub LastName_DblClick(Cancel As Integer)
> >Dim stDocName As String
> >Dim stLinkCriteria As String
> >stLinkCriteria = Me.LastName
> >stDocName = "frmHours_Worked subform"
> >DoCmd.OpenForm stDocName, , , "LastName = " & stLinkCriteria
> >
> >Debug.Print stLinkCriteria
> >
> >End Sub
> >
> >Secondly, the subform that appears when you double click on the lastname is 
> >set for datasheet view, however, when it appears it is in single form view.  
> >If you click the design key on the toolbar and then back to the form view it 
> >will appear in datasheet view.  How do I fix it so that the subform opens in 
> >datasheet view without have to click design then form?
> 
> 
> Because the Last Name field is type Text, you need to make
> sure the criteria value is quoted:
> 
> DoCmd.OpenForm stDocName, , , _
> 									"LastName = """ & stLinkCriteria & """"
> 
> Open the form in design view and set the form's DefaultView
> property to DataSheet.  Then close and save the form.
> 
> Another way is to specify the view on the OpenForm method's
> View argument:
> 
> DoCmd.OpenForm stDocName, acFormDS, , _
> 						"LastName = """ & stLinkCriteria & """" _
> 
> -- 
> Marsh
> MVP [MS Access]
> 
0
Utf
12/12/2007 4:25:00 AM
Reply:

Similar Artilces:

Help Needed ... Probably simple for you gurus ... locking cell after data entered and
positioning next cell after enter is hit I am very computer illiterate and have searched and experimented for 2 days with limited success here is currently what the macro does when data is entered into a cell that cell is filled with the color green....simple...and works also there is 3 different columns with data being entered...A....B....C....after data is entered in C it automatically puts the current date in the corresponding cell in column D....that is somewhat ok...would like it to time stamp it also here is features that I would like to add Once data is entered to a cell I would l...

Help, can't shrink to fit so art prints on 1 page!
Working on a large banner, and want to share it with my team for review. Original file is 15mg, too large to send, and making a .pdf results in 45 pages of tiled images. Other desktop publishing software allows you to select a "fit to one page" or "scale" option so your image is reduced to one legal or letter sized sheet of paper. I can't even print this out to walk around and show my co-workers for comment. So - making a .pdf doesn't work, selecting Reduce then Fit to Paper Size won't work, asking to scale this to 20% won't work, printing to Offic...

HELP! Design Review & Risk Management topics (in ASP projects) required
Hi, I have to take 2 one hour sessions on the following topics: * Project Design Review * Project Risk Management Can you please recommend any topics/examples/case studies for the same? Any help will be much appreciated. On 9/6/2010 8:12 AM, gangestech wrote: > Hi, > > I have to take 2 one hour sessions on the following topics: > > * Project Design Review > * Project Risk Management > > Can you please recommend any topics/examples/case studies for the same? > > Any help will be much appreciated. > <http://www.dofactory.com/Fra...

Pivot Table Help #3
I have a lot of data that I am trying to analyze with a pivot table and am not sure how to go about it. Columns are (1) District (2) Store # (3) 2003 Score - these are #s or text ("incomplete") (4) 2004 Score - these are #s or text ("incomplete") For each district, I am trying to find out 3 things: (1) % of stores incomplete (2) Average score for 2003 & 2004 - I've got this one working properly (3) % change between 2003 & 2004 I can successfully analyze the data in a spreadsheet but there is too much to go through and thought a pivot table was the way to ...

Help! This is serious!
All of a sudden when I try to open an .xls file, it comes up with a page full of little "y"'s. What is wrong? I have data that I need to recover! I hope you have a backup. And keep your backups safe and offline. http://www.mvps.org/dmcritchie/excel/backup.htm Check your font in the fontbox Right click on the sheet tab, view code, anything in there? Tools, Autocorrect check the righthand column for y's Does this happen with just one worksheet, the entire workbook, all workbooks, all MS Office programs like Excel and MS Word. Does it happen on ne...

IFD install needed help
Hi, After facing many errors and difficulties during the CRM 4.0 installation I successfully installed the product. Now I am trying to install CRM as IFD. I want to install IFD without any problems So I have some questions. What is the SDK root domain and web application root domain mean? Is the below config file format is alone enough for IFD installation. Is there anything else i need to look up.?? I went through the MSDN documentation. Can anyone guide tell me how and what configurations i should use to install IFD successfully. <CRMSetup> <Server> <ifdsettin...

Help with Dates
Hi all, I have a table with field name "ConnectionDate". I want to create a form with ComboBox that will show the "ConnectionDate" as month and year only. The value the user will choose will be a criteria for a query. Please help. TIA, Tom ?Format(Date,"mmyyyy") would return 112007 so, SELECT Format(ConnectionDate,"mmyyyy") AS ConnectDate FROM SomeTable -- Dave Hargis, Microsoft Access MVP "Tom" wrote: > Hi all, > > I have a table with field name "ConnectionDate". > I want to create a form with ComboBox tha...

Help, No pictures in Pub 2003
I installed Pub 2003 and none of my graphics are showing on my document. Does anyone know how I can fix that? Thanks Ed looks left. Ed looks right. No-one is there. Furtively, Ed picks up a note from Xeroid <lnerbonne@cogeco.ca>. On it is written: > I installed Pub 2003 and none of my graphics are showing on my > document. Does anyone know how I can fix that? View > Pictures...? -- Ed Bennett - MVP Microsoft Publisher http://www.mvps.org/the_nerd/ Before reading this message, view the disclaimer: http://mvps.org/the_nerd/disclaim.htm when I open a Pub made file fro...

Event ID 125
I have received an Event ID 125 on an Exchange 5.5 server. Along with this I have an ID Error #193, 1005 7 and 100 amonst others. Is it possible that during a backup in schedule+ for a client on the client's machine, that the procedure corrupted the EDB.log or any other file? If so, should I be using Microsoft Base Article #275602 to repair. At this point, my Echange server is down. Thanks. Hello Deb Based on the limited information; the 275602 XADM: Microsoft Exchange Server Information Store May Stop After a http://support.microsoft.com/?id=275602 would be a recovery method. Did y...

Need Help Troubleshooting Report Manager
Here is my situation. I can=92t get to Report Manger via IE. IE just displays the =93Internet Explorer cannot display the webpage=94 error message. Details: OS is Server 2008 Standard. I=92m running a standalone computer =96 not connected to the internet. I=92ve installed MS Loopback Adapter. I=92ve installed SQL Server Reporting Services and it=92s running ok. I verified by going to Services. Status is Started, Startup Type is Automatic. The account I=92m logged in as is a member of the Administrators Group. Windows Firewall is off for all profiles. Under Network Connections ...

Need to remove help compile in project
Can someone tell me how to remove the help build process from a project? Thanks What does this mean? You want to remove part of the build? If yes, just remove those files from project. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "mike" <nospamplease.com> wrote in message news:%236ooDIkGHHA.1468@TK2MSFTNGP04.phx.gbl... > Can someone tell me how to remove the help build process from a project? > Thanks > > I've tried removing the help files but when I build, the help compiler is still invoked. The project show a couple of .rtf files in the dependenc...

HELP with Office 2004 not loading after installing Adobe Acrobat 7.
Hi, Word, Excel and Powerpoint won�t launch anymore after installing Adobe Acrobat 7. I checked on office/startup and the three folders are empty. All I get is window telling me that app couldn�t launch.. Error reporting. Is there a way to fix this? I don�t want to reinstall OSX. I have uninstalled and reinstalled Office several times to no avail. Entourage launches fine. Thanks, AJ There are troubleshooting techniques linked from this page, work through them: http://www.mcgimpsey.com/macoffice/ see General Troubleshooting and Troubleshooting for Office 2004 If they get to the splash sc...

FORMATING COLUMNS..... HELP
I need to format columns to allow only 7 characters and the rest of the data to go into column B -- JTEFUN "JTEFUN" <JTEFUN@discussions.microsoft.com> wrote in message news:6C5C7A99-E83F-430E-9576-6D1DB57B9311@microsoft.com... >I need to format columns to allow only 7 characters and the rest of the >data > to go into column B > -- > JTEFUN > If you mean that if a user types a lot of data into the one cell and that when they reach 7 characters the rest of the data is automatically inserted into the next cell, then I don't think you can do that....

Running Office 2001 on Mac OS 10.2, help
This might be a dumb question, but I don't want to screw things up. I was running Mac OS 9.0.4 and I downloaded OS 9.1, 9.1.2, 9.2.2 and then the new 10.2. However, all my software is still in the 9.1 classic. I want to use it all in the new OS 10.2. Will Office 2001 Academic Edition work in OS 10.2? Do I need to uninstall it in OS 9.1 first, then install it is OS 10.2? Or, can I just drag and drop it on the 10.2 desktop or in the applications folder? I have a lot of other expensive softwares in OS 9.1 that I don't want to have to upgrade, but need to be able to use in OS 10.2. Wi...

Help: message "Requesting data from Exchange Server"
Has anyone figure out why we receive the pop-up message "Requesting data from Exchange Server" when we try to open an email in outlook? We are using Exchange 2000. Is there a parameter we can change to fix this issue? "Kenny" <anonymous@discussions.microsoft.com> wrote: >Has anyone figure out why we receive the pop-up >message "Requesting data from Exchange Server" when we >try to open an email in outlook? We are using Exchange >2000. > >Is there a parameter we can change to fix this issue? Depends to a greater or lesser extent ...

Need to postpone WM_CLOSE
I need to perform cleanup when the user clicks the close button or exits the application. It's a standard MFC single doc app. I saw a sample of a Dialog app that processed the WM_CLOSE message, performed cleanup (closed threads; which is what I need to do), reposted the WM_CLOSE message to itself and postponed the close until the next WM_CLOSE message. I don't know where the best place to do this is in a CDocument type app. I would like to do it before the document tries to close. Can someone help? Thanks Handle OnClose of your mainframe and do not call the base class if you ...

Rookie in need of some advice
I have searched but not real clear on some solutions. I'll do my best at explaining (and I apologize if I'm in the wrong newsgroup). We just added a 2nd server to our LAN. Problem is that the original DC DNS Suffix was a top level domain not the suggested "MAINOFFICE.LOCAL" Our old DC was used for authentication, terminal services and it did have Exchange 2000 installed and the main use of Exchange was to share contacts and a public calendar but the public folders after backing up last night seem fairly large Well due to growth and to avoid future problems (the DNS Suffi...

MCT Needed
NetCom Information Technology is looking for Microsoft Certified Trainer in these areas http://www.netcominfo.com/vendors/2/Microsoft_training.html. Please send your resume at jobs@netcominfo.com Russell Sarder President & CEO NetCom Information Technology www.netcominfo.com "The One-stop Center for IT Training" NetCom Information Technology, headquartered in the Empire State Building, New York City, has become one of the top training centers in USA offering blended learning solutions on more than 250 courses, 25 IT Vendors Training and 50 certification tracks. NetCom Info h...

Outlook help
Hello. After years of using Outlook on my Windows XP machine, now I get the following error: Cannot start Microsoft Office Outlook. Unable to open the Outlook window. The set of folders could not be opened. The server is not available. Contact your administrator if this condition persists. Can anyone help? Where is the actual data kept? Can I retrieve it? Can you open Outlook in Safe Mode by using the /Safe switch? If you need help using Outlook command line switches, look here: http://support.microsoft.com/default.aspx?scid=kb;en-us;296192 -- Jocelyn Fiorello MVP - Outlook ...

Need to create an automatic hyperlink
I'm using Excel 2003, Windows XP. Okay I have a workbook with a main spreadsheet and about 150 other spreadsheets with images in them. I have the names of the other spreadsheets in cell b2. How do I create a hyperlink that will concantenate the name in cell b2 to a hyperlink and point it to the spreadsheet with that name? I know I can do it by manually selecting each cell and hyperlinking manually, but with over 150 it's taking a while. Thanks. I tried =HYPERLINK("file:////"&b2,"Click me!") and it fails (can't find specified file)...

Debugging tips needed
Hello all, I'm currently working with modifying a large MFC app to handle Unicode correctly. After upgrading Windows to SP2, the application no longer works at a certain stage. The really strange thing is that the application simply dies without giving the control back to the debugger without raising any access violations or ASSERTs. This happens regardless of the debugger used (have tried Visual Studio, Windbg, cdb). The error code given during exit is 1282, ERROR_STACK_BUFFER_OVERRUN. Running the application without a debugger attached raises the error report dialog in Windows, which t...

need help with list box?
Hi I have a huge table of about 20000 records. how can I restrict entry for a few columns. I am new to excel programming. For example. I have a list of colors (red, green, blue) that I want to go under the Color column. how can I allow the user to click on a pulldown or list box similar to ms access for each cell. thanks in advance. Hi you could use 'Data - Validation'. See: http://www.contextures.com/xlDataVal01.html >-----Original Message----- >Hi > >I have a huge table of about 20000 records. how can I restrict entry for a >few columns. >I am new to exc...

Help! Can't Restore my "Old" Money 2005 Backup
Help! Can't Restore my "Old" Money 2005 Backup. Windows 2000 replaced by Windows XP Home on C:\Drive. D:\Drive contains data and Backup only. PC is on a wired Home Network . I recently upgraded from Windows 2000 Pro to Windows XP Home. I wiped the C: Drive clean (formatted) and did a "Fresh" install of Windows XP Home. I reinstalled Microsoft Money 2005 Deluxe, then tried to restore my "old" 2005 Money Backup file (My Money Backup.mbf) from both D: Drive and USB thumbdrive. The Restore shows a default location ..."C:\Program Files \My Money.mny&quo...

Pls help me out.
Greetings to all. i am a new Mac user. i inherited a ibook loaded with MsOffice for Mac that is in german. do you think i can reset the language to english without having to re-install the whole sofware? if so, how? thank you all so much! On 10/5/04 4:16 PM, in article 2ee7bd29.0410042316.72004f36@posting.google.com, "luc" <tchinlai@yahoo.com> wrote: > Greetings to all. > > i am a new Mac user. i inherited a ibook loaded with MsOffice for Mac > that is in german. > do you think i can reset the language to english without having to > re-install the whole s...

Newbie questions (and maybe I need a 1hr tutorial for some $)
Hello, I am a competent vb6 programmer and understand a bit of C structures. However the C++ system is mystifying me..I simply will have to learn it to now.... I have 2 questions. 1> Can anyone tell me how code "Program 4. Microphone Select" at http://www.codeproject.com/audio/ADMixer.asp can be changed to simply self close by clicking the IDOK button routine programmatically? This is the simple effort that triggered my current angst.! (I 'think' need to set a state in BOOL CSelectDlg::OnInitDialog" to fake the IDOK event or trigger to the OnDestroy routine). Fr...