Please Scroll Down to See Forums Below
napsgear
genezapharmateuticals
domestic-supply
puritysourcelabs
UGL OZ
UGFREAK
napsgeargenezapharmateuticals domestic-supplypuritysourcelabsUGL OZUGFREAK

Anyone here know Access well?

OMGWTFBBQ

brobe
I know Access very well as a database and how to use it that way - but I am trying to work on reports and forms in a custom Access application that is about 5 years old and I am getting frustrated.

Anyone? forms, reports, text boxes?
 
All I can say is I actually feel sorry for you at this moment.
 
I remember trying to generate reports from a database and it was the most horrific experience I ever had.
 
On the good side I am going to totally redesign this thing using a SQL server and a much better front end.
On the bad side they are giving me no real free time to get it done and instead having me hack at the old one to make it just barely do what we want - and they give me no forewarning just a "holy shit we need this done RIGHT NOW!!!"


Currently I have a report that has all kinds of text boxes on it.
What I need to do is really basic, but I'm having problems doing it.

I need one of the text boxes to simply look at a textbox on one of the forms (TextBoxA for example) and look at its value. If the value is not null, then show that value in the text field.
If it is null, then instead just display a default value.

It should be incredibly easy to do - but I can't get the report text box to properly be aware of the form textbox and I have no idea how they reference each other programatically and then what the syntax is for the reference in the IIf() call.

Rough code would be "=Iif(formIWant.TxtBoxName & "" <> "", "ASS", "BALLS")"

But that shit ain't working - at best it pops up a window asking me what the value for that shit should be. That would be fine for now if I were using this thing, but for our retards that would make them shit their pants and run around screaming "IT IS DIFFERENT!!! OH GOD, HELP ME!!!"
 
Yes I really know many things, including access and all things database.

You basically want to access the value of a form object and reflect it against a report?
 
jerkbox said:
who the hell is jon polito?

lol

He played Gideon in "The Crow."

I had to look up his name, because I forgot. But it looks EXACTLY like him bror.

Get on AIM for a second bro.
 
From Zero - I have no clue what you are talking about. It is Mr. Belvedere. If that is the person you are talking about, then yes - otherwise, no.

CipherLock - yes. I know database shit inside and out - this has nothing to do with that unfortunately - this is all forms and reports crap.

There is a master form. In that is a... window. In that window (that has to be the wrong term - more like a frame) it loads other reports based on what you choose off of a list. When you hit another button, it reads the data that is in that form in the window, runs some query, and then dumps out a report based on that.

In that report that dumps out, there are text boxes and shit. Those text boxes reference that query - they basically are tied to database fields for the query so that as the report iterates over the set returned, it populates the fields.
No big deal.

But I don't care about the query - that shit is all working well enough.

What I want is part of the previously static text to now change based on what was in that form.

Like I said before, a basic if statement that looks at a field - if it is empty, then display default text.
If it is populated, then display the text that it is populated with.

It is going to look like:
"blah blah blah" & Iif(whatever,"ass","titties") & "blah blah blah"

I just don't know the whatever part that will allow me to reference that textbox in the form.
 
Well that didn't show how I wanted it to.

=[Forms]![frmname]![Text0]

that is better, put that in the textbox of the field to get the value from the form, you ok with the testing?
 
I think for ass and balls you need [dbname].[ass] [dbname].[balls]

And if you have spaces between field names you have to use qoutes around the field names inside the brackets.

I've only used access through vb so I have no clue about forms.
 
hmm, tried that and it still says "#Name" in the output... will have to search on more shit.

I'm really glad that they use a non-standard DOM, that was a fantastic idea on their part.

I can recall a girl I used to work with always whining about how Access shit sucked - I only ever did the database side for which I felt that it was okay.
but this shit sucks.
 
OMGWTFBBQ said:
hmm, tried that and it still says "#Name" in the output... will have to search on more shit.

IS THE FORM OPEN when the report is? If the form isn't open you'll get the #name
 
Wodin - "ass" and "balls" are just strings - one is whatever is in this optional text box, the other is a static constant that I will just write in the if statement.

CL- It is on the screen and visible - if that means it is open, then yes.

The name I used to reference it is the one that it is saved as in the Forms list.

If it is a sub window, do I need to do:
Code:
=[Forms]![outerFormName]![subFormName]![textBoxName]

This seriously should be the most trivial thing in the world. I should be laughing at this except that it is taking me over a day to do what is fucking retardedly easy I'm sure.
 
= Forms![frmParentForm].[frmChildForm]![textBox] looks right, sometimes you have to leave out the square brackets around the textbox.

Try a few, if you don't get it I'll do better with a screen shot in design view (of the form)
 
Damn that's some fucked up references. LOL!!

No wonder I avoid access forms.
 
It will automatically put in the brackets around shit even if I leave it off.

The problem is I don't know what the names of these things are.
There is the main form thing (forms.mainForm) and then it has two frames on it that load sub forms. You click on an item in one frame (sub form) and it populates the other frame with another form (sub form).
All of this stays on the screen.
Then in that sub form, you fill out text boxes.
Then in the mainForm, there are buttons - when you are done filling out whatever subform is there, then you press any of the given boxes.
They run shit and then display a report, based on which thing you selected in the first frame and populate it based on what was in the second frame.

In the report that comes up, all I want to do - this is absolutely fucking retard smacking themselves in their crooked helmet easy - is have a text box in the report that populates itself based on the text box that is the form in the second frame of the main form.

So you would think it is just:
forms.mainForm.subForm.textBox

But that either gives me "Error" or "Name" errors.

At best it pops up a window at run time that asks me to fill some variable if I don't use the full path.

And yes, I am doing the [Forms]![mynuts]![etc]![eatADick] - but it is easier for me to write it here logically like the DOM style of forms.mynuts.etc...

I wish there were a child here for me to take out my anger on.
 
You know, you'd probably be better off not coding it yourself, I didn't realize you suck at code ;)

Right click on your textbox in the report and choose properties (if the properties box isn't already open)

go to the Data tab - Control Source - choose the '...'
double click on forms - loaded forms (if the source form is open)
drill down to your desired subform choose the control

That is all you really have to do, when you hit ok the code is written for you
 
CipherLock said:
You know, you'd probably be better off not coding it yourself, I didn't realize you suck at code ;)

Right on sister.

That did it though, I tried to give you karma but it said something about you being too overly gay or something.

I knew it had to be retarded.

The way it showed it is:
[Forms]![mainForm]![Sub].[Form]![TextName]

I have no clue where "sub" came from - that name is nowhere visible and I can't find it in any of the properties boxes.

Anyway - looks like I can get it from here.

Man this sucks - but that was easy - KNOWING IS HALF THE BATTLE.

thanks again - it is like having a 2 ton heavy thing taken off of my shoulders
 
I'll take your wife. I need a backup.

And your welcome. Access is the Anti-Chirst of desktop databases.
 
LOL

I just showed this to the people that need it and they were like GREAT! and then just gave me a list of more changes.

I tried to explain that we need to sit down and just write a new program that is better and they totally agreed - but apparently want me to just do it either at the same time somehow (??) or at home in my free time.
I should do it at home and then charge them for it and then also sell it to competitors.

Oh well, at least I'm not doing as much network shit - our main file server crashed again today (a whopping 9 days of uptime) and I was swearing a lot with that.

The best part is when that crashes, it somehow breaks our mail too. I don't know how or why and I don't care - I just wish it didn't do it.

This next thing I have to do will be roughly 80 billion times more complex than this last thing - so I guess I had better get started on that.
(fortunately the deadline on this one is far less immediate)

Fucking shit ass pisscock.
 
Top Bottom