Solved

fields format at design time ??

Posted on 2002-06-20
8
151 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

822 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