clear a textbox with an input mask (1 Viewer)

chewy

SuperNintendo Chalmers
Local time
Today, 20:55
Joined
Mar 8, 2002
Messages
581
when the user clicks no in msgbox I want the textbox that the data was just entered into to be cleared. The test box has an input mask 099.099.099.099;0;_ I cant get it to work. Or if you have any other ideas I would appreciate it
 

Mile-O

Back once again...
Local time
Today, 20:55
Joined
Dec 10, 2002
Messages
11,316
NameOfYourTextbox = Null
 

chewy

SuperNintendo Chalmers
Local time
Today, 20:55
Joined
Mar 8, 2002
Messages
581
tried that before it doesnt work...get errors
 

chewy

SuperNintendo Chalmers
Local time
Today, 20:55
Joined
Mar 8, 2002
Messages
581
here it is. If you try to put a duplicate IP address you get a box and choose no and I want it to clear. Add a new record with IP 192.168.25.21
 

Attachments

  • clear textbox.zip
    61.1 KB · Views: 113

chewy

SuperNintendo Chalmers
Local time
Today, 20:55
Joined
Mar 8, 2002
Messages
581
all that does is select it
 

chewy

SuperNintendo Chalmers
Local time
Today, 20:55
Joined
Mar 8, 2002
Messages
581
it just selects the text that is in the text box that you just enter
 

WayneRyan

AWF VIP
Local time
Today, 20:55
Joined
Nov 19, 2002
Messages
7,122
chewy,

You can't clear it because in the table's design you specify:

Allow zero length? No

You could remove that constraint and perform the check
yourself.


Wayne
 

chewy

SuperNintendo Chalmers
Local time
Today, 20:55
Joined
Mar 8, 2002
Messages
581
still cant quite get it still the same error
 

WayneRyan

AWF VIP
Local time
Today, 20:55
Joined
Nov 19, 2002
Messages
7,122
chewy,

Did you read my last post?

You can't clear it (per table design).

You can't set it to anything (won't be unique).

You must change the table design.

Wayne
 

chewy

SuperNintendo Chalmers
Local time
Today, 20:55
Joined
Mar 8, 2002
Messages
581
i did but I cant get it still
 

WayneRyan

AWF VIP
Local time
Today, 20:55
Joined
Nov 19, 2002
Messages
7,122
chewy,

That box around the Upper-Left-Hand corner states that the
IpAddress field is part of an "option group"!

Required = No
Fix Input Mask

hth,
Wayne
 

chewy

SuperNintendo Chalmers
Local time
Today, 20:55
Joined
Mar 8, 2002
Messages
581
im sorry I just dont understand. Is the option group the problem? Because I got rid of it and it still did the same thing. I also changed the required to no and still no luck
 

WayneRyan

AWF VIP
Local time
Today, 20:55
Joined
Nov 19, 2002
Messages
7,122
chewy,

Boy am I confused.

I deleted all of the fields in your table except the IPAddress.

I cloned a form leaving only the IP.

If I disable the BeforeUpdate, I can change anything.
If I enable the BeforeUpdate, I get that STUPID message
no matter what.

Will keep researching ...

Wayne
 

WayneRyan

AWF VIP
Local time
Today, 20:55
Joined
Nov 19, 2002
Messages
7,122
chewy,

This problem revolves around the input mask. Most of your
existing data does not conform to it.

Change record #1 to 111.111.111.111
Goto record #2
Change record #2 to 111.111.111.111

Your code will work perfectly, except for the mask.

Change record #1 to 111.111.111.111
Goto record #2
Change record #2 to 222.222.222.222
Then change record #2 to 111.111.111.111 and your code will
work fine.

IP Not required, enforce in code.
Real input mask = ?

Wayne
 

chewy

SuperNintendo Chalmers
Local time
Today, 20:55
Joined
Mar 8, 2002
Messages
581
i wasnt really sure what you meant by that, and then I got busy with work. So did you fifure out should I just take out the input mask?
 

WayneRyan

AWF VIP
Local time
Today, 20:55
Joined
Nov 19, 2002
Messages
7,122
chewy,

I'm not good at some of the finer points of input masks.

IPs have an "inconsistent" format

xxx.xxx.xxx.xxx
xxx.xx.x.xx

and so on.

Maybe someone will see this and help out, but in the interim:

1) You have embedded spaces in some of your existing IPs

2) You can use an event to trim out spaces, or maybe even
"ping" the IP entered/modified to validate it.

just some thoughts,
Wayne
 

chewy

SuperNintendo Chalmers
Local time
Today, 20:55
Joined
Mar 8, 2002
Messages
581
i just got it i jus ttook out the input mask on the table, but I left the mask on the form and it works perfect!

On a side note how would I ping an address from in access?
 

Users who are viewing this thread

Top Bottom