Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 5th, 2005, 5:19 PM   #1
Jamesisgan
Newbie
 
Join Date: Oct 2005
Posts: 3
Rep Power: 0 Jamesisgan is on a distinguished road
Exclamation Help in Access/vba please!

I have an application in which I am populating text boxes in a form by way of a query from a table. If I run the application without breakpoints/stepthroughs it doesn't populate all the fields. If I run it with breakpoints/stepthroughs it works like a charm. Any help would be appreciated! Thanks!
Jamesisgan is offline   Reply With Quote
Old Oct 5th, 2005, 6:07 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
You need to fix it. That's about the only response supportable by the information you give. If you haven't yet read a "How to Post a Question...." thread, or the forum's rules/FAQ/guidelines, that would be a nice step.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Oct 6th, 2005, 8:43 AM   #3
Jamesisgan
Newbie
 
Join Date: Oct 2005
Posts: 3
Rep Power: 0 Jamesisgan is on a distinguished road
Here is the section of code that is causing my problem:

strSQL = "Select * from qryfrmProcessInvoices_Lookup WHERE Invoice_Number=" & lngInvoice_Number
Set rsTemp = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)
If rsTemp.RecordCount > 0 Then
rsTemp.MoveFirst
If rsTemp![PostedInd].Value = False Then
Me.txtAddInvoice_Date = rsTemp![Invoice_Date]
Me.txtAddProject_Cntr = rsTemp![Project_Cntr]
Me.txtAddJob_Nmbr = Nz(rsTemp![Job_Nmbr], "")
Me.txtAddSidemark = Nz(rsTemp![Sidemark], "")
Me.txtAddSalesperson_UserID = Nz(rsTemp![Salesperson_UserID], "")
End If

rsTemp.Close

End If

the app knows what information is in the recordset but without placing a breakpoint in the code it doesn't populate the text boxes. If any other information is needed, let me know and I'll post it here. Thanks.
Jamesisgan is offline   Reply With Quote
Old Oct 6th, 2005, 9:06 AM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Unless there's a temporal issue, and it seems unlikely that you would be the first to discover it, something must be happening when the debugger stops the process. Why don't you insert some statements to output the values of important variables to a log (or other output device) so that you can see what path the various tests are causing to be taken. Message boxes, requiring a response, would also generate a temporal delay and cause it to "work" if it's truly a temporal thing. Generally speaking, your variables hold the key to what's going on.

In your perusal of my suggested references, you seem to have missed the one regarding putting tags around your code to preserve its formatting. Try it, you'll like it.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Oct 6th, 2005, 9:15 AM   #5
Jamesisgan
Newbie
 
Join Date: Oct 2005
Posts: 3
Rep Power: 0 Jamesisgan is on a distinguished road
Thanks for the response. I had used the messages boxes prior to the post, and it didn't make it "work". However, I found that doing a requery to the text boxes after the code posted did fix the problem. So if anyone else has this problem, that seems to be the fix! Thanks again for your input DaWei.
Jamesisgan is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:31 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC