Solved

fields format at design time ??

Posted on 2002-06-20
8
149 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
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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now