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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Takes 2 clicks of cmdbutton to get records to show in subform 1

Status
Not open for further replies.

Vie

Technical User
Jan 22, 2004
115
0
0
US
My form has a subform whose recordsource is set to an SQL statement when a command button is clicked (not doubleclick). The problem is the records don't appear in the subform on the first click -- actually they do sometimes but most of the time, it takes two, sometimes three clicks to get the records to appear. I've never seen anything like this and can't for the life of me, pin down why this happening.

Do any tek-tippers have any ideas for me?
 
How are ya Vie . . . . .

It almost sounds like some corruption . . .

[blue]Post the code for the button![/blue]

Calvin.gif
See Ya! . . . . . .
 
Hi AceMan,

Yeah, I think it might be too. I tried exporting the code, etc. to a new mdb file and that didn't help.

Truth is, I just set up a new barebones system with an upgrade to Access 2003 (from 2002 - my old PC died of registry disease). Most things have been so much better but this one thing I cannot figure.

I hoped somebody else might've experienced something similar and could offer some advice, but probably it's something I shouldn't waste too much time. Maybe I should just start over from scratch? You think?

thanks,
Vie

 
Vie . . . . .

I don't remember if it 2003 or XP than has [blue]problems refreshing[/blue] under certain conditions, but try this:
Code:
[blue]   Application.Echo False
      'Your code for updating RecordSource Here
   Application.Echo True[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thanks, I'll give that a shot!

Vie
 
Hi Aceman, Didn't work. If it is some sort of corruption, what do you think might help to resolve it? -Vie
 
Vie . . . . .

[blue]Recreate the form[/blue] under another name with a [blue]new button[/blue]. If that doesn't work try a [blue]Compact & Repair[/blue]. If that doesn't work then I would [blue]uninstall/reinstall[/blue]. . . .

[purple]What version Access?[/purple]

Calvin.gif
See Ya! . . . . . .
 
Thanks AceMan, I've done both of the first two -- guess I'll have to try the third. Oh, and it's Access 2003 running on XP. -Vie
 
what about a decompile then a compile?

Try the following:
1. Make a backup copy of the file
2. Compile and Repair database
3. Start-Run- msaccess.exe /decompile "C:\Path\FileName.mb"
4. recompile your code

--Todd


TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
 
mustangcoupe, No luck with that either but thanks for the suggestion. Vie
 
Hi Vie,

Have you tried adding

me.refresh

to your command button code?

Peter

Remember- It's nice to be important,
but it's important to be nice :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top