Help with Form population

pkphy39

New member
Local time
Today, 04:33
Joined
Jan 17, 2002
Messages
5
Hi.

Access newbie (pretty much). I have a background in MSSQL with web-frontend (ASP) programming, so all this Access stuff is driving me nuts.

I can build the queries alright, I can make the forms - I can even get one to submit information. I'm basically building a simple issue log tracking system for my new employer - enter an issue, status, user, etc. Well, they want to track progress on these issues, so I have a resolution description that people can enter.

All I need to know, really, is how to pass a value (based on a query) to a disabled, locked textbox on a form. I have tried a million different things, but I keep getting a #NAME? error. I'm not missing the DLL it says is sometimes missing with this error.

Please let me know if you have any idea how I can fix this problem. If it involves digging into the VB, that's fine, but please be specific as to where any code should go (as, I said, I'm a relative newbie).

Thanks a million. Please let me know if any more information is req'd.
Mark
 
Newbe, hah? Do you know code? If so, you may set the text of a text box like this:

Forms!frmForm!txtControl = "Your Value"

where frmForm is the form on which the control resides, txtControl is the control (in your case a text box), and Your Value is whatever you want to set the control as.

I don't know where, or what, your value is. But using this you should be able to set the textbox for anything you want.
 
As far as code, I learned enough VB to get me through programming web frontends for SQL-backed applications, so I'm pretty confident in my abilities.

Unfortunately, it's not as simple as setting the control to a simple string. I want to set the value to be the result of a SQL query.

Forms!myForm!TextBoxName = [SQL Query result]

The query will return a numerical value - that's it. But what's the syntax for doing something like that?

Any further help would be greatly appreciated.

Thanks.
 
Try using a stored procedure in MSSQL which returns a single value based on an SQL query
 
OK - I can't get the DLookup (or even a test value!) to populate in the textbox. Here is the code I have...

Private Sub Form_Load()
Forms!Form_Add_ResolutionDescription_New!In_IssueID = "test"
End Sub

is this where the code belongs (in the Form_Load sub)?

This is really beginning to get to me.
Also, here is the code I had for the DLookup of the query I'm trying to get information back from:

DLookup(Expr1, Query!Query_SelectMaxIssueID)

Where Expr1 is the value returned...

Any help would (again) be greatly appreciated.

Thanks,

Mark Fitz
 
UPDATE:

OK - I got the "test" to work (don't ask - I forgot how annoying typos can be when programming), and am now getting a Run-time error - "Object Required". Sounds like a problem with my DLookup - likely a syntax problem.

If anyone can see any glaring problems with the syntax of the DLookup, please let me know. Otherwise, I can hopefully figure this out in a reasonable amount of time.

Thanks again,

Mark
 
PROBLEM SOLVED.

As it turns out (and as you all probably knew), it was a syntax error. Here's the code that works. Chalk this one up to not reading thoroughly:

DLookup("Expr1", "Query_SelectMaxIssueID")

..I just needed the stuff in quotes! (and didn't need the Query! before the actual query name).

Thanks for all your help everyone. Hopefully now I'll be able to finish this on schedule.

Mark Fitz
 

Users who are viewing this thread

Back
Top Bottom