Primary Key that Contains Number as a String & starting with zero

I have two forms: frmFaculty and frmCourse.  I have linked these two forms
through the FacultyID.  When I open the frmCourse through the frmFaculty it
transfers the FacultyID because I given frmCourse OnCurrent the following
language:

If Me.NewRecord Then
[FacultyID].DefaultValue = Forms![Faculty]![FacultyID]
End If

My problem is that if the FacultyID is 094511 for some reason it does not
pick up the zero.  This is odd because I made this field into a string. 

Can someone help me in explaining how do I make the zero appear in the front
when I open the frmCourse?
Thank you!!

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1

0
cutepaloma405
2/25/2010 7:39:49 PM
access.formscoding 7493 articles. 0 followers. Follow

5 Replies
1218 Views

Similar Articles

[PageSpeed] 48

cutepaloma405 -

There can be a difference in a value and how it is displayed.  Is the 
FacultyID being stored correctly as a string in the Course table?   Also, is 
there formatting on the frmCourse control for the FacultyID?

-- 
Daryl S


"cutepaloma405 via AccessMonster.com" wrote:

> I have two forms: frmFaculty and frmCourse.  I have linked these two forms
> through the FacultyID.  When I open the frmCourse through the frmFaculty it
> transfers the FacultyID because I given frmCourse OnCurrent the following
> language:
> 
> If Me.NewRecord Then
> [FacultyID].DefaultValue = Forms![Faculty]![FacultyID]
> End If
> 
> My problem is that if the FacultyID is 094511 for some reason it does not
> pick up the zero.  This is odd because I made this field into a string. 
> 
> Can someone help me in explaining how do I make the zero appear in the front
> when I open the frmCourse?
> Thank you!!
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1
> 
> .
> 
0
Utf
2/26/2010 3:07:02 PM
Thank you for replying Daryl.  There is no formatting on the frmCourse
control for the FacultyID.  Actually the FacultyID started out as a number
field but I changed it into a string.  I changed the FacultyID field into a
string on both the frmFaculty and frmCourse.  Any ideas? 

Daryl S wrote:
>cutepaloma405 -
>
>There can be a difference in a value and how it is displayed.  Is the 
>FacultyID being stored correctly as a string in the Course table?   Also, is 
>there formatting on the frmCourse control for the FacultyID?
>
>> I have two forms: frmFaculty and frmCourse.  I have linked these two forms
>> through the FacultyID.  When I open the frmCourse through the frmFaculty it
>[quoted text clipped - 11 lines]
>> when I open the frmCourse?
>> Thank you!!

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1

0
cutepaloma405
2/26/2010 3:57:13 PM
Hi - 

It may be because form controls don't have an explicit data type associated
with them, so the data is interpreted as numeric.  Try forcing the control to
be a string, like this:

[FacultyID].DefaultValue = "'" & Forms![Faculty]![FacultyID] & "'"

HTH

John



cutepaloma405 wrote:
>Thank you for replying Daryl.  There is no formatting on the frmCourse
>control for the FacultyID.  Actually the FacultyID started out as a number
>field but I changed it into a string.  I changed the FacultyID field into a
>string on both the frmFaculty and frmCourse.  Any ideas? 
>
>>cutepaloma405 -
>>
>[quoted text clipped - 7 lines]
>>> when I open the frmCourse?
>>> Thank you!!

-- 
John Goddard
Ottawa, ON Canada
jrgoddard at cyberus dot ca

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1

0
J_Goddard
2/26/2010 4:32:25 PM
Who's the man?.....U!!!  Thank you, thank you.  It worked.  I love this site!!
!!  Have a really good day!!!!!

J_Goddard wrote:
>Hi - 
>
>It may be because form controls don't have an explicit data type associated
>with them, so the data is interpreted as numeric.  Try forcing the control to
>be a string, like this:
>
>[FacultyID].DefaultValue = "'" & Forms![Faculty]![FacultyID] & "'"
>
>HTH
>
>John
>
>>Thank you for replying Daryl.  There is no formatting on the frmCourse
>>control for the FacultyID.  Actually the FacultyID started out as a number
>[quoted text clipped - 6 lines]
>>>> when I open the frmCourse?
>>>> Thank you!!
>

-- 
Message posted via http://www.accessmonster.com

0
cutepaloma405
2/26/2010 6:38:02 PM
Cutepaloma405 -

Try specifically making it a string, like this:

[FacultyID].DefaultValue = """" & Forms![Faculty]![FacultyID] & """"

-- 
Daryl S


"cutepaloma405 via AccessMonster.com" wrote:

> Thank you for replying Daryl.  There is no formatting on the frmCourse
> control for the FacultyID.  Actually the FacultyID started out as a number
> field but I changed it into a string.  I changed the FacultyID field into a
> string on both the frmFaculty and frmCourse.  Any ideas? 
> 
> Daryl S wrote:
> >cutepaloma405 -
> >
> >There can be a difference in a value and how it is displayed.  Is the 
> >FacultyID being stored correctly as a string in the Course table?   Also, is 
> >there formatting on the frmCourse control for the FacultyID?
> >
> >> I have two forms: frmFaculty and frmCourse.  I have linked these two forms
> >> through the FacultyID.  When I open the frmCourse through the frmFaculty it
> >[quoted text clipped - 11 lines]
> >> when I open the frmCourse?
> >> Thank you!!
> 
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201002/1
> 
> .
> 
0
Utf
2/26/2010 6:38:03 PM
Reply:

Similar Artilces:

Creative Sorting with Letters and Numbers
Greetings, We use Excel 2003 and sometimes have a need to sort data that includes figure references with the section and figure indicators in one column (Section B, Figure 1 would be "B-1" in that cell). When we sort, however, we find that figure B-10 will come before B-2. We understand that Excel is sorting in such a way that it's not 'ten', it's 'one-zero' which comes before two. We've tried using different cell formatting (General, Number, even Custom) to no avail, though some of the formats in "Custom" appeared intriguing. Is there a ...

microsoft office professional 2007 trial product key
My computor is not accepting the product key,what must i do? From where did you get the product key from -- Peter Please Reply to Newsgroup for the benefit of others Requests for assistance by email can not and will not be acknowledged. "Kaiser" <Kaiser@discussions.microsoft.com> wrote in message news:7C6101C5-A75D-4A84-B48C-992FDA921A70@microsoft.com... > My computor is not accepting the product key,what must i do? He may have stolen it from somewhere. What difference does this make? Has your wife also joined your sister and your mum in the escort ...

How do I convert numbers to the opposite sign?
I need to change all positive numbers in the spreadsheet to negative numbers, and vice versa in Excel. times it by -1 Put -1 in an empty cell edit|copy that cell select your range to fix Edit|paste special|check multiply. CindyatRWD wrote: > > I need to change all positive numbers in the spreadsheet to negative numbers, > and vice versa in Excel. -- Dave Peterson Type a '-1' in some random cell and copy it (ctrl+C). Then select the cells you want to switch and Edit > Paste Special, select Values and Multiple and click OK. "CindyatRWD" wrote: >...

Primary partitions
Say I have four hard drives(physical drives) in one computer. Is the four primary partition per each physical hard drive? In theory than I could have 16 primary partitions in a computer that has four physical drives. Is this statement correct? With Microsoft's partitioning that's correct. There are other utilities that will let you do more than four primary partitions. If your installing Win 7 let it do the partitioning. Win 7 has a 100MB partition for system files and then another primary partition for the rest of Win 7. Win 7, as does Vista, you can shrink...

auto numbering in a table
I have a table with a column using auto numbering for itentification purposes. Now I want to sort it, having the numbers stay the same but I want to turn off the auto numbering. When I do the numbers go away. Anyway to do this? You can convert numbers to text. Select the relevant column and then do the following: Press Alt+F11 to display the Visual Basic Editor. Press Ctrl+G to activate the Immediate window. Type Selection.Range.ListFormat.convertnumberstotext and press Enter. Numbering will be removed from the selected column. (Note that if numbering was applied v...

Imap Account "The folder 'Inbox' cannot contain items"
I'm having a strange problem. I'm using Outlook 2003 and I connect to both my Company's Exchange server and my own IMAP server which is running Dovecot on a Linux box. I've been using this setup for over six months now without a problem. Suddenly I'm unable to access my IMAP receiving the message "Unable to display the folder. The folder 'Inbox' cannot contain items." If I delete my IMAP account and add it again, I can access my inbox for the first time, but if I shut Outlook down and restart it I'm unable to access my inbox again. Bo...

two units on primary Y axis
Hay!! I have spent quite some time looking for a solution and I doubt there is one. Is it possible to have two units on primary Y axis such us for example EUR /USD.. For example primary Y would have values such us : 1000 EUR / 1300 USD, 2000 EUR/2600 USD etc.. If there was a way that custom format would include possibility of calculation for unit.. tnx Rado Hi, Perhaps you can create a fake value axis using a dummy data series plotted as xy-scatter. Display data labels which are linked to cells that have the required text. Data for series would be like, X Y Label 0 ...

Starting a new list within the one numbered list style
Hi, I'm using Word 2003 and am having trouble with numbered lists (as I see that lots of people do). I have created a style (paragraph type) for how I would like all my numbered lists to be formatted. They are simple, 1 level lists. My problem is that when I add a new list with the style that I want, the numbering follows on from the previous list. When I then re-start the numbering, all the formatting of my style disappears and I have to change it manually. Is there a way to tell Word 2003, "this is a new list, but of the same style as the previous list"? ...

Print Correct Page Number
I have a Visio 2003 file with foreground footers on 3 pages. If I print all pages, I get the correct footers, page 1 of 3, page 2 of 3, etc. However, if I print just page 3, it comes out as page 1 of 1. How do I get it to print the correct page number and total pages? Thanks in advance! ...

Is it possible to pull the Sequence Number of the Issue or Risk from the reporting database?
So far, I don't see in the table / view structures for WSS* any column that appears to be the Sequence number of the Issue or Risk. Anyone know what column(s) I might be overlooking? Or please confirm this is not possible. Thanks, Andy Novak UNT Hi Andy, When you create or modify a view the column name is ID. this is the sequense number for a Risk or and Issue Hope that helps -- Marc Soester [MVP] http://www.i-pmo.com.au "anovak@unt.edu" wrote: > So far, I don't see in the table / view structures for WSS* any column > that appears to be ...

loading a count of another entity into a field on the primary entity
Hi I have a custom entity associated with Opportunities called Required Conditions. From the Opportunity enity I need to be able to check the count of the Required Conditions in order to disallow/allow certain actions. The simplest way of doing this (from what I can see) would be to populate a field on Opportunity with the count of the Required Conditions when the Opporutnity is loaded, however I have no idea how to do this. Can anyone out there assist? TIA Saira You may want to consider a callout (3.0)/plug-in (4.0) instead. Whenever one of your custom entities is created, updated...

What is the formula to convert a whole column containing date to text?
What is the formula to convert a whole column of date to text? If I am to do it cell by cell, I need to press F2 then put a --> ' in front of the date. Is there a way I can do it with formula? I have tried CONCATENATE to combine column a which contains ' with date 12/31/03. Column A Column B ' 12/31/03 =CONCATENATE(A1,B1) However, the end result I got is as follow. '37986 instead of '12/31/03 Please help! Hi Caine one way: =TEXT(A1,"mm/dd/yyyy") where A1 stores your date value. Copy this down ...

Logons container under the storage group
What does logons container log in? It is kind of confusing. Some have two entries, some have more... We had some security issues and I was looking into this container and it was confusing as what exactly does it log in? Please help or refer me to some documentation in this regard. And with Outlook 2002 and above, every time a user adds someone's name in the meeting request, or attendee, it shows as he/she is logging into the other's mailbox. Is there any way to avoid that, or is it known to everyone? Although we want them to be able to see their free/busy schedule but wit...

Outlook 2007 Won't Start at all
When I try to open Outlook 2007 I get an error message: The application failed to initialize properly (0x80000003). Click OK to terminate the application. I've only just installed Office 2007, all the other programs work fine. When I try to run Microsoft Office Diagnostics I get an error message as well: You cannot run Office Diagnostics because you do not have sufficent permissions. To run Office Diagnostics, access to the Microsoft Windows event log is required. I am using Vista Home Premium (32 bit) and there is only one account (mine) which is an administrator...

License Key Problems
I needed to unplug everything that was connected to the computer including the USB license key. After moving the computer to a different location and pluging back the USB license key, the POS tells me that the registration was not found. That was ok for a few days but now the POS has turned red and says its for Evaluation only. I'm afraid that the pos will stop working and prevent me from cashing people out on my lone register. I've tried pluging the key back in, re-starting the computer and nothing seems to work. Does anyone have any suggestions? try putting it to ano...

Reading text strings from a listbox in a different process
Does anyone have any ideas how to extract text strings from a listbox in different process? I've tried the following code, but had no success: HWND hWnd = ::FindWindow(NULL, m_window_caption); HWND hCtrl = ::FindWindowEx(hWnd, NULL, NULL, (LPCTSTR) m_controlname); long cId = ::GetWindowLong(hCtrl, GWL_ID); char buffer[2048]; int y = ::SendDlgItemMessage(hWnd, cId, LB_GETCOUNT, 0, 0); ::SendDlgItemMessage(hWnd, cId, LB_GETTEXT, y -1, (LPARAM) buffer); First, are you sure you have the right handle? You seem to be going through a fairly convoluted set of calls to solve a simple probl...

Can't use key and keyref with an attribute in a group
Hi, Why can't I create a key and keyref with an attribute declared in an attribute group? Code below describes what I'm trying to accomplish. <!-- An attribute group --> <xs:attributeGroup name="AttGMain"> <xs:attribute name="Name" type="xs:string" /> <xs:attribute name="Type" type="xs:string" /> </xs:attributeGroup> <!-- CT using group above --> <xs:complexType name="ctView"> <xs:all> <xs:element name="Control" type="ctControl" /> <xs:eleme...

Starting a MS Excel workbook with a particular worksheet
When I open a workbook, it always does with SHEET 1. How do I start it with a worksheet other than SHEET 1? I think it is useful when renaming the worksheets. Thanks Excel will open to the worksheet when the file last saved unless you use a workbook_open or auto_open event to goto the worksheet desired. -- Don Guillett SalesAid Software donaldb@281.com "icasaresg" <icasaresg@discussions.microsoft.com> wrote in message news:2944F136-1181-4878-9C26-F9CF459F942D@microsoft.com... > When I open a workbook, it always does with SHEET 1. How do I start it with a > worksheet...

Contacts should have both a primary contact and primary account
My customer would like to have both a primary contact and primary account like the account record. ---------------- 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.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=dcb8b04e-171f-4d5a-8b96-f...

Shortcut key #2
My forward slash key I believe is acting like a shortcut key. When in a table and I push it, it highlights the file menu. I cannot put a forward slash into my tables. It does not show any shortcut keys through. I would appreciate any help as I don't want to mess things up. Thanks for any ideas. To remove it, tools>options>transition and clean out the menu key box -- Regards, Peo Sjoblom "J Evans" <evans@yvn.com> wrote in message news:05f701c3b3ba$8296dd80$a401280a@phx.gbl... > My forward slash key I believe is acting like a shortcut > key. When ...

better way to determine if a string is number or not?
what is the better way to determine if a string is number or not? You could use SpanExcluding() with a string like _T("0123456789") and see if the result is an empty string (all characters matched). http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/chstring_spanexcluding.asp Tom "kathy" <yqin_99@yahoo.com> wrote in message news:1138896330.406206.197550@g14g2000cwa.googlegroups.com... > what is the better way to determine if a string is number or not? > You can loop through the characters and use _isdigit. It easier for integ...

Where to add a Toolbar to start it up with Access, not the databas
Hello All I have been developing for a while now and i have started to gather a bunch of tools that are making my life easier. however some are hidden away on the add in menu. i made a toolbar with the commands on it, but the tool bar only appears in the databases that it has been imported to. this is a developer toolbar not a user tool bar. i want this toolbar to appear in all of my applications, but not when i "publish". i always make MDE's for my frontends and this pretty much hides the toolbars, so i am not really worried about them, but it would be nice tha...

Retrospect auto-start problem
I installed on my WinXP a Retrospect backup software came along with my Maxtor disk. I don't want it run as a daemon for automatic backup (only need to do manually) --I set the Retrospect automatic option to "off", and went to WinXP's "Run -> services.exe" to have disabled 2 Retrospect related items. But every time when I logon, Retrospect daemon starts (a little icon appears in the "clock/volumn" area; and listed in the system "processes"). I do not want it consume my RAM/CPU - how can I disable this? Thanks in advance! Joe Hi, This i...

Format Auto Number
I have added an identity field which starts at 100000 and increments by 1. However, when I display this field on my custom entity, it is displayed as 100,000. How do I format this to remove the ","?. Thanks No way to do it easily. You can try hiding the field and adding a new one without formatting applied. You can also try to change the class name of the input field, but before going into that: what's so bad about having it displayed this way? It's much easier to read in my opinion, so why do you want to spend time on it? -- Michael H�hne, Microsoft Dynamics CRM ...

License key transfer
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have a Microsoft Office for Mac 2008 Home and Student edition. It is to my understanding that I have 3 license keys. I've already used up all 3 license keys on 3 different computers. However, this is my situation. I bought a new Mac and want to install Office on it. Am I able to uninstall Office on my old Mac, then install Office on my new Mac with the same license key I use on my old Mac? Thanks! On 9/26/09 5:04 PM, in article 59b7d5cc.-1@webcrossing.caR9absDaxw, "okatidubi@officeformac.com" <okati...