473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Refresh Detail in Access

46
The following code is not displaying the data that this statement is selecting on the Access Form. What's wrong with it? Thanks in advance.
Expand|Select|Wrap|Line Numbers
  1. Private Sub cbxEvaluatee_AfterUpdate()
  2. sqltext = " select dbo.idtoname(i.eid)as evaluator, dbo.idtoname(i.evalteeid) as evaluatee,* from viewt120 v , evalissue i " & _
  3.      " where v.evalrecno = I.RecNo " & _
  4.     " and formno = 'T120'" & _
  5.     " and evalteeid = " & Me.cbxEvaluatee
  6. Debug.Print sqltext
  7.     Me.Refresh
  8.     Me.Detail.Visible = True
  9. End Sub
Feb 26 '08 #1
5 1561
Delerna
1,134 Expert 1GB
Where are you actualy executing the query?
and how are you connecting it to the form?
Feb 26 '08 #2
missinglinq
3,532 Expert 2GB
As Delerna has intimated, your code doesn't actually run your SQL statement. In point of fact you cannot run SQL SELECT statements from code in Access, only Action statements, such as APPEND, DELETE, UPDATE, etc. Where/how would Access display the results? To do this from VBA you'd have to run a stored parameter query, providing the required Evaluatee parameter.

Linq ;0)>
Feb 27 '08 #3
Delerna
1,134 Expert 1GB
Tenesh, you could say
Expand|Select|Wrap|Line Numbers
  1. Private Sub cbxEvaluatee_AfterUpdate()
  2. sqltext = " select dbo.idtoname(i.eid)as evaluator, dbo.idtoname(i.evalteeid) as evaluatee,* from viewt120 v , evalissue i " & _
  3. " where v.evalrecno = I.RecNo " & _
  4. " and formno = 'T120'" & _
  5. " and evalteeid = " & Me.cbxEvaluatee
  6.  
  7. me.RecordSource=sqltext
  8.  
  9. Me.Refresh
  10. Me.Detail.Visible = True
  11. End Sub
  12.  
  13.  
to execute the select query on you form. I have bolded the change I made.

Of course the form would need to be able to handle the recordset returned. IE textboxes with their datasources set correctly etc.
Feb 27 '08 #4
teneesh
46
Where are you actualy executing the query?
and how are you connecting it to the form?

I was missing the:
me.RecordSource=sqltext,
I didn't realize it was required.
Feb 27 '08 #5
NeoPa
32,556 Expert Mod 16PB
If items have beed added or removed from the underlying recordset then line #9 (Delerna's code) should be replaced by :
Expand|Select|Wrap|Line Numbers
  1. Me.Requery
Feb 28 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Tom Post | last post by:
I am doing a simple php header refresh -- header('refresh: 10; url=msgs.php'); that just does a call back to my script every 10 seconds. Things work great when the page is first loaded up, but if...
2
by: Gary \(Girish\) | last post by:
Hello: I am using SA-FileUp to enable members to upload their product images to my ISP sever. When member uploaded a new image file, the file name is replaced with the member ID and the old file...
19
by: Jay | last post by:
I'm trying to refresh browser when some new information is available in DB. is there any way to force to refresh browser? Thanks. -Kev
2
by: AA | last post by:
Do anyone know how to refresh the datagrid without setting datasource to nothing and initialize the grid again? My case is that I have form consisting from two part. The upper part is a datagrid...
6
by: scott | last post by:
I guess this is a simple one but I can't seem to get it to work. I want to refresh an open form "onClose" of another. I have a Close button on a form which has User Details on it. If I update...
12
by: martin1 | last post by:
All, is there window form refresh property? I try to set up window form refresh per minute. Thanks
4
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays...
0
by: Phillip Ian | last post by:
Tried this over in CSharp.General and didn't get anything, so I thought I'd try again here. If there's an AJAX specific group I could ask this in, please let me know...I did look. I'm trying to...
7
by: Kevin Wilcox | last post by:
Hi I'm trying to emulate, within access, the gantt chart timeline / task planner aspects of ms project. Creating the chart on the form has been easy enough; I use a series of unbound text boxes in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.