[mso] Re: opening a new form based on a field in a previous form

  • From: "Dian D. Chapman" <dian@xxxxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Mon, 11 Feb 2008 23:48:22 -0600

Are you getting an error description? If so, what does it say?

Or, try tossing it into a MsgBox to see what displays.

 Msgbox stLinkCriteria 

If that doesn't display anything...try 

MsgBox "[ClientID]="

Sorry, I don't know the Access object model all that well...so I could be
missing something.


Dian D. Chapman
Technical Consultant, Microsoft MVP
MOS Certified Instructor, Editor/TechTrax Ezine
Tech Editor for Word & Office 2007 Bibles
https://mvp.support.microsoft.com/profile/Dian.Chapman

Free PC Tutorials: http://www.mousetrax.com/techtrax
Free Word Tricks eBook: http://www.mousetrax.com/books.html 
Optimize your business docs: http://www.mousetrax.com/consulting
Learn VBA the easy way: http://www.mousetrax.com/techcourses.html 


-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf
Of Leeba
Sent: Monday, February 11, 2008 1:47 AM
To: MS_Access_Professionals@xxxxxxxxxxxxxxx; mso@xxxxxxxxxxxxx
Subject: [mso] opening a new form based on a field in a previous form

I have a form with a list of clients. There is a combo box with a list of
projects for each client or an option to add a new project.
When clicking a new project, it should automatically fill in the client ID
to match the clientID on the previous form.

My code is:

Private Sub Command34_Click()

On Error GoTo Err_Command34_Click

 

    Dim stDocName As String

    Dim stLinkCriteria As String

 

    stDocName = "projects"

    

    stLinkCriteria = "[ClientID]=" & Me![ClientID]

    DoCmd.OpenForm stDocName, , , stLinkCriteria

 

Exit_Command34_Click:

    Exit Sub

 

Err_Command34_Click:

    MsgBox Err.Description

    Resume Exit_Command34_Click

   End Sub

 

This is not working. Anyone figure out why.

TIA,

Leeba



*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the
dropdown menu at the top.  This will allow you to unsubscribe your email
address or change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to share files with the group, you must join our Yahoo sister
group.  This group will not allow for posting of emails, but will allow you
to join and share problem files, templates, etc.:
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE
SHARING ONLY.

If you are using Outlook and you see a lot of unnecessary code in your email
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************



-- 
Internal Virus Database is out-of-date.
Checked by AVG.
Version: 7.5.448 / Virus Database: 269.19.20/1231 - Release Date: 2/4/2008
12:00 AM


-- 
Internal Virus Database is out-of-date.
Checked by AVG.
Version: 7.5.448 / Virus Database: 269.19.20/1231 - Release Date: 2/4/2008
12:00 AM
 

-- 
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.448 / Virus Database: 269.20.2/1231 - Release Date: 2/10/2008
12:00 AM
 

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, visit the group's homepage and use the dropdown 
menu at the top.  This will allow you to unsubscribe your email address or 
change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to share files with the group, you must join our Yahoo sister group. 
 This group will not allow for posting of emails, but will allow you to join 
and share problem files, templates, etc.:  
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE 
SHARING ONLY.

If you are using Outlook and you see a lot of unnecessary code in your email 
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************

Other related posts: