Forms; Autonumber and number fields

I have this problem whereby I can't link an autonumber field from a form to 
another form having a number field. Currently I have coded the codes below 
for a String expression but I'm not sure on how to execute on autonumber and 
number. Anyone can help?

Private Sub Findings_Click()
Dim strOpenArgs As String
Dim strCriteria As String
Dim strFormName As String
On Error GoTo Proc_Error
strFormName = "Findings"
strCriteria = "[CR Number] = '" & Me![CR Number] & "'"
strOpenArgs = Me![CR Number]
DoCmd.OpenForm strFormName, WhereCondition:=strCriteria, OpenArgs:=strOpenArgs
Proc_Exit: Exit Sub
Proc_Error:
   MsgBox "Error " & Err.Number & " in Findings_Click:" _
            & vbCrLf & Err.Description
   Resume Proc_Exit
End Sub


0
Utf
10/10/2007 3:14:00 AM
access 16762 articles. 3 followers. Follow

1 Replies
1253 Views

Similar Articles

[PageSpeed] 2

On Oct 9, 9:14 pm, Firz <F...@discussions.microsoft.com> wrote:
> I have this problem whereby I can't link an autonumber field from a form to
> another form having a number field. Currently I have coded the codes below
> for a String expression but I'm not sure on how to execute on autonumber and
> number. Anyone can help?
>
> Private Sub Findings_Click()
> Dim strOpenArgs As String
> Dim strCriteria As String
> Dim strFormName As String
> On Error GoTo Proc_Error
> strFormName = "Findings"
> strCriteria = "[CR Number] = '" & Me![CR Number] & "'"
> strOpenArgs = Me![CR Number]
> DoCmd.OpenForm strFormName, WhereCondition:=strCriteria, OpenArgs:=strOpenArgs
> Proc_Exit: Exit Sub
> Proc_Error:
>    MsgBox "Error " & Err.Number & " in Findings_Click:" _
>             & vbCrLf & Err.Description
>    Resume Proc_Exit
> End Sub

You cannot create relationships and enforce referential integrity
(cascading updates/deletes) if you have data in the tables that
violate these rules.  Either that or make the foreign key in the child
table a LONG, then you can create the relationship.  You might need to
create a new DB, import the structure of all your tables, and then
create the relationships while they're empty.  Then you can import all
the data afterward moving from parent table to child to grandchild...

0
pietlinden
10/10/2007 3:36:52 AM
Reply:

Similar Artilces:

Excel,Auto fit
How can I make a large text field display all the lines on my spreadsheet and when I print it. About 1024k of characters will print, otherwise you'd need to use a text box Regards, Peo Sjoblom "ancastle" wrote: > How can I make a large text field display all the lines on my spreadsheet and > when I print it. Oops! Not 1024k, about 1kb or 1024 characters Regards, Peo Sjoblom "Peo Sjoblom" wrote: > About 1024k of characters will print, otherwise you'd need to use a text box > > Regards, > > Peo Sjoblom > > "ancastle"...

Formating Alignment based on numbers
How do I align a column of numbers on the decimal point? On Feb 15, 4:05 pm, littleredhairedgirl <littleredhairedg...@gmail.com> wrote: > How do I align a column of numbers on the decimal point? Hi littlehairedgirl, have a look at these sites: * http://peltiertech.com/Excel/NumberFormats.html * http://www.ozgrid.com/Excel/CustomFormats.htm * http://groups.google.com/group/microsoft.public.excel/browse_thread/thread/ffae8c65eba4d9c8?hl=en Have a nice day Michael ...

Reservation Form
I have an active website for my business. I built it in Frontpage 2002. It no longer will send email through the settings I used ( Reservation form) and I cannot get it to take any of the settings I give it. I do not think that my knowledge is sufisticated enough. And, I don't think that I am entering the information completely enough. I am using a simple form with a single enter button. Can you help? May be possible. -- ~~~~~~~~~~~~~~~~~~ Rob Giordano Microsoft MVP Expression Web "FrontPage 2002 on windows XP" <FrontPage200...

return number
can someone tell me how to return a line in my query that shows the first number in this field : S-7L/8L result = 7 Number or digit? What is the expected result of this: S-72L/8L You might have to create a Function to find this result. Cheers, Jason Lepack On Apr 23, 2:16 pm, "Jeff Klein" <jklein@nospam> wrote: > can someone tell me how to return a line in my query that shows the first > number in this field : S-7L/8L > > result = 7 ...

User Defined Field (String)
Does anyone know of a way I can force a user-defined field (I'm working specifically with User Defined 1 in Sales Trx Entry - a String(20) field) to force formatting at data entry time to US dollar (eg. $100.00) formatting? Either with VBA or Modifier? I would need to do this a couple of individual User Defined fields in the SOP User Defined fields entry window. Thanks in advance. Not a good way to do this - you could maybe use a vba event to format the data after the user enters it but vba isn't real happy typically of setting the current field when running its ...

catching the error number
I'm catching an exception when I try to listen with my WinSocket control. To try this code I'm trying to open a socket in a port already used: try { if (m_WinSock.GetState()!=0) m_WinSock.Close(); m_WinSock.SetLocalPort( portNumber ); m_WinSock.Listen(); } catch(CException *e) { char info[300]; UINT code; e->GetErrorMessage( info, 300, &code ); TRACE( "Exception opening Server TCP Port: %s -->ID:%d\n", info, code ); } I'm trying to get the error ID into the variable "code" and always getting code=0. I don't know if 0 is the error number...

Auto populate a form form an open form
Hi I have a main form with customer names and addresses and would like to add a control button on this form which opens up another form which is used for recording telephone calls on. What I have been trying to do is auto populate this call log form with information from the main form ie name and address? Any thoughts Thanks Chris Chris, Please don't re-post the same question twice. You have to be patient and wait for a reply. Responders are volunteers, and you may not get an answer right away. Posting twice causes some people to respond to the first post, while others are ...

form pozition on screen
I would like to find form position on screen. It's similar to DoCmd.movesize, but I want discover "parameters' for form position (left corner, top corner, etc) Are you saying that you want to find out what the current position IS? If so, you can use something like this: MyFormLeftVariable = Me.Left MyFormTopVariable = Me.Top MsgBox "My Form is at " & MyFormLeftVariable & VbCrLf & MyFormTopVariable Or however you want to use it. -- Bob Larson Access World Forums Super Moderator Utter Access VIP Tutorials at http://www.btabdevelopment.com ___________...

copy properties Under forms
Hi, I'm wondering if someone can help me with something on copying properties. I've checked the access help but can't find anything there. This is what i want to do. I'm copying text boxes, labels that has caption, name and other information in the properties that i want to keep when i copy the information to another tab on a form. Is there a way i can copy the property information without doing alot of manual work by going into each text or label box. I hope this makes sense. thanks for you help in advance. Keith When you copy a control, everything about the cop...

Outlook Contacts phone numbers
I have Windows XP pro with Office 2007 and a verizon Ozone phone runing windows 6.1. I sync my Outlook to the phone locally through Activesync. My problem is, I add phone numbers to my contacts in Outllok, and the when I try to call them from my windows phone, the phone sees the number as international and the call fails. Apparently this is because the number has an extention. Verizons answer is to edit the phone number on the phone itself and add the letter p where outlook puts an x (for extention). this works until you edit the person in outlook then the x is put back ...

What is the purpose of 'Dummy' window in the Command forms
I am wondering why GP has Dummy window with title "~internal~" for the Command forms. For example Command_Financial form has Dummy window Do I need to create Dummy window for my Command forms. If so why I need it. Any comments appreciated!!! Hi Mandeep, The Dummy window is there as a placeholder. It really doesn't do anything, but should be there in order for the form to work properly since your form needs to be open for the commands to be available. The title ~internal~ just prevents this window from showing up in the Security assignment windows. Make sure that...

Report broken down by results from a calculated field
Hello, I have a query which calculates a date which is 100 days from the initial referral date. Other fields in the query are: patient ID, date of surgery and the reason why no surgery within 100 days of referral if applicable (this field is added through a combobox that only gives choice of 3 options). I would need a report that groups the results of the calculated field (those who had surgery within 100 days of initial referral, those who did not have surgery within 100 days and those who do not yet have surgery date. Those who do NOT have surgery within 100 days of referral, I nee...

Cannot open the Insert object (Pdf file) form Excel 2000(9.0.8968 SP-3)
Dear All, I am no idea why I cannot open the embedded object (Pdf file) inside Excel file which using Windows ME. Once clicked the object icons, then it shows the error message likes " the embedded object cannot be opened by the source application" I used the Adobe reader 6.01 as the source application. Actually, I searched the related forum from the Internet. However, I cannot solve the problem. Anyone helps? Thanks tlee Hi, I can't test 2000 in ME, but it works fine in 2003 under XP. -- If this helps, please click the Yes button. Cheers, Shane Devenshire &q...

Catching duplicate Customer PO numbers
Would like the Customer Purchase Order Number field on the Sales Order to have a character recognition format to help detect duplicate customer purchase order numbers that may be entered in error. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.co...

Form class module for non-existent form
Hi, After copying a form with a class module, something went wrong. I now have a class module for the new form, but the form no longer exists. I am unable to remove the in-limbo class module. I want to use that name for my form, which is not possible as long as that class module is in the way. How do I get rid of the in-limbo class module? I've tried repairing tha DB as well as "msaccess /decompile" but it hasn't helped. Anything else? Thanks, Kjell Kjell, A class module is not part of a form, but a separate module. It sounds like your 'in-limbo' module is...

How to create Lookup fields
Hi ! Is it possible to create lookup fields ? During my customization I added a field mapping to contacts, created that field in the deployment manager & mapped it to Contact but on the form it's always a text field and not a lookup ,any ideas??? v1.2 of CRM does not support adding lookup fields. Matt Parks ---------------------------------------- ---------------------------------------- On Wed, 7 Apr 2004 11:22:12 -0700, "Yara" <anonymous@discussions.microsoft.com> wrote: Hi ! Is it possible to create lookup fields ? During my customization I added a field map...

Numbering in Office 2007
Can someone please tell me why, when I start a numbered list in Microsoft Office 2007. When I reach the number 100, 101, 102 etc. and then type the titles after each number, Microsoft Office automatically leaves a half inch gap between the number and words. I have tried everything to backspace over the gaps, no luck!!! I am running Windows XP Professional It is because you are not aligning the numbers. Try this: 99. Create the numbered list. 100. Select the list items you want to realign. 101. You'll find the Numbering tool in the Paragraph group on the Home tab. Cli...

Setting the Windows Cursor during Form Processing
hiya gurus I would like to force the mouse cursor to immediately become an hourglass when some long processing/quering commences on a form. it appears that it takes some time for Access to show the hourglass and usually only after the user clicks the form a couple of times because there appears to be nothing happening... Is there an easy way to do this from within Access.. I have done it in VB6 using Me.MousePointer = vbHourglass but this does nto work in Access.. any suggestions? cheers Jeff mmmmm Screen.MousePointer = 11 guess this does it? "jeff" <jeff@work...

Position 2nd Form according to 1st Form
I have 2 Forms. When the 1st Form is openned and want I open the 2nd Form, I want it to position itself about 15cm form the Left and 20cm from the top of the 1st Form. I am using Access 2003, Thanks. "AY" <AY@discussions.microsoft.com> wrote in message news:CFA3A4B5-36D9-4A20-AB57-601290155335@microsoft.com... >I have 2 Forms. When the 1st Form is openned and want I open the 2nd Form, >I > want it to position itself about 15cm form the Left and 20cm from the top > of > the 1st Form. I am using Access 2003, Thanks. You should be able to use Nicole Calinoiu...

TOURNAMENT FORMS
Need tournament draw sheet single elimination template. You may find some old NCAA basketball tournament forms out on the web. Try http://google.com HHSTENNIS wrote: > > Need tournament draw sheet single elimination template. -- Dave Peterson ec35720@msn.com ...

Run Macro only if certain form is open
I have programed a maco to open one of various forms depending on criteria on an open form. Is there a way to run a "follow up Macro" based on which form opens? In other words can I run a macro based on wheather a certain form is active? -- Thanks, Chuck Take a look at the RunMacro Method of the DoCmd object. You can have it as part of the OnLoad of the form in question. Chuck wrote: >I have programed a maco to open one of various forms depending on criteria on >an open form. Is there a way to run a "follow up Macro" based on which form >opens? In other w...

Forms and Input Data
I created a report form on Sheet 1 and a set of input data on subsequen Sheets 2, 3, ... link to the report. The report is to show informatio on either of the data I select. Are there simple steps for me to pick either set of data I want t display on the report? I've thought of a pull-down menu so that if select "1", the report will show data set "1", and so on. Yet I don' know how to do it. I tried the "replace" command by highlighting al the cell in the Report sheet then type "2" in place of "1" to replac the data set then hitting...

Modal form opens on startup
Evenin' - I hope this doesn't come across as stupid, but I'm almost completely unfamiliar with Access. A client of mine has an Access 2000 database containing some business information, and he'd like to have me import it into Quickbooks. The problem I have is that I cannot get to the information to export it from Access. When the file is opened, I get a (I presume) modal form, configured as a 'splash screen' type of thing. Has my client's logo, and the name of the fellow who wrote the Access app. Click that, and it closes, then opens another form for...

Making first column number in order
I am very unfamiliar with Excel or databases in general. My first column/row is numbered by Excel. However, when I delete fields, the numbers don't move up to account for that. So let's say my first row has a 1 in front of it. After I delete fields/rows 2-6, Excel shows that column as 1, then the next number is 7. I am probably not using the correct terminology here, but basically, after I delete fields, I cannot look at the last number to see how many I have. I have to manually count them. I'm sure there's a simple button to push to fix it, but I haven't foun...

Trying to delete form border, and it deletes all borders
I made a form with several individual areas that have borders. At the end I decided to try a border around the whole form. Now that I don't like it, I was trying to delete the form border, but it deletes all the borders in the form as well. How can I just delete the border around the form and not the rest of the individual borders? I'm actually on a different computer, because of the printing, will I be able to undo my way out of it maybe, or do I have to be on the computer where I made the form. One more question, will the form retain the undo feature for ever, or will it stop ...