Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Me.Refresh Issue

Status
Not open for further replies.

onefootout

Technical User
Oct 23, 2007
42
US
Hi All,

I've got a quick-add form for employee info. Using a button onclick event, I do a little validation before I refresh and add the info to the table, then show a button that takes them to the full reccord. The validation works, but it keeps breaking on the refresh command. Can someone point out what I'm doing wrong? Thanks!

Code:
Dim z As Integer

    If Me.Text121 <> 0 And Me!State = "PA" Then
        z = MsgBox("PA State Exemptions can only be zero.")
        Me.Text121 = 0
        Exit Sub
    End If
    

Me.Refresh

Me!Command2.Visible = True
 
Quote:

A DOUBLE POST! Sorry I answered your other identical one.
The text of that reply appears below:

but it keeps breaking on the refresh command


Do you mean there is a breakpoint in the code?
If there is an error, what is its number & description?
The only code I see above is the validation stuff - where is the rest of the code that adds the record before Me!Command2.Visible = True (assuming that's the button that takes them to the full record)?
Also, names like Text121 and Command2 are meaningless to anyone but you. Do yourself & whoever else might have to maintain this code a favor and use something descriptive (i.e. txtExemptions or cmdShowRecord) instead of the defaults. It's easy, it's fun, & everyone is doing it!

"Teamwork means never having to take all the blame yourself."
 
there's that faulty mouse button again!


Ian Mayor (UK)
Program Error
Your lack of planning is not my emergency!
 
Yeah, It was an accidental triple post, actually. I kept getting connection reset errors, and assumed it didn't post.

So I figured it out, apologies for such an annoying thread.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top