?
Solved

fields format at design time ??

Posted on 2002-06-20
8
Medium Priority
?
156 Views
Last Modified: 2010-05-02
Hi all :

when Creating anew database, table,fields ... i know that i can assign a fromat for my field's in the table.

the first Field is a "0000000" format , seven digit number .

the second is a "000" format , Three digit number.

the third one is a "hh:mm:ss AM/PM" a Time format Field .

how to do this by code , i've heard that it's something related with the Field Attribut's , but how to set these atributes at design time .

by the way , when <data entry> , i'm solving this problem it's ok for me , but when the user makes any changes in this table i want him to be restrected with the format i specify , and that is done by setting the format at design time for the field's as i expect ...

many thanxxx for ALL...

0
Comment
Question by:kenmostafa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 2

Expert Comment

by:vbDoc
ID: 7097378
What's the database?
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 7097830
You want to do this user data entry from VB or your back-end, I hope its Access.
0
 

Expert Comment

by:alicelknight
ID: 7099553
kenmostafa:

In a VB Project, on a form, click the control they will be entering data into (i.e. textbox), look in the properties window and set the format in the property called DataFormat.  This is for data-entry on a VB form.

Alice
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:kenmostafa
ID: 7101338
hi all :

sorry for lating , but there's a couple of things that i have to get clear :

1 - i'm connecting with Access2000
2 - first the data entry trick is solved and no problem
    so no way for entering wrong formatted data in the text
    box's .
3 - now , i'm giving the user permision to change entries
    through a Dbgrid control , so here i want to restrect
    the user Entry , as i explained befor to fit the format
    that i wanted , if not , an error message must pop up
   

i think its clear now for all , and many thanxxx for replying !!
0
 

Author Comment

by:kenmostafa
ID: 7101441
Hi all :

i've solved the problem by my self...
i've tried the following , to test the user's entry :

Private Sub DBGrid1_BeforeColUpdate(ByVal ColIndex As Integer, OldValue As Variant, Cancel As Integer)

select case colindex

case 1 ' this is a "000" format Field
if (entered) <> (what i want) then
msgbox "Error"

dbgrid1.text = oldvalue
exit sub

and so on for the rest of the fields

End Sub
0
 

Expert Comment

by:alicelknight
ID: 7101630
kenmostafa:  Glad to hear that you solved your problem.  I do not know the rules for deleting the question, but as for me, I do not care if you do.

Alice
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7923675
kenmostafa, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7968413
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month9 days, 1 hour left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question