Form issues

Blabolat

Registered User.
Local time
Today, 11:58
Joined
Feb 11, 2011
Messages
31
Greetings everyone.. first thread.

First I"m sure this has been covered to death, but I have no idea how to do a search for this so, If you excuse me I'll explain what I"m trying to do.

I have a continuous sub form that I use, that has
the ID, Product and I use another field where I hyperlink (open) to get the details of the Product.

When I click on 'Open' it works fine, the Product detail form opens up and shows the client and product info.

When I click 'new' of course it just opens up to a blank form with out any info.

What I'd like to do and can't seem to do because I'm so dense at this is have the client 'ID' come up from the main form so that I don't have to select it from a drop down box.

I'm pretty sure this can be done, I looked through the examples of NW trader and others, but ultimatly I get lost in all the programming languages.

Well if anyone can understand my dribble, I'd sure like to hear back. thanks and by the way.. looks like a great place to get some good info.

Cheers!
 
In the form that pops up to add a new record you would use the OpenArgs to pass the value.

So, in the code for opening the form you would use:
Code:
DoCmd.OpenForm "FormNameHere", acViewNormal, DataMode:=acFormAdd, OpenArgs:=Me!YourIDFieldNameHere
And then in the LOAD event of the form you would use

Code:
If Me.OpenArgs <> "" Then
   Me!YourIDFieldNameHere = CLng(Me.OpenArgs)
End If
 
Thanks for replying..
I"m putting that code in a button Under event procedures on click..
my Id I want to carry through is called Client ID

that is now the problem, I"m getting a compilation error, "expected end of statement" If I take the ID part off, seems to be ok

I'm wondering if it views 'ID' in the Client ID field as being a reserved word?
headaches headaches headaches.

But boblarson, I do appreciate you spending time to try to help this nitwit out.

Ken
 
Could you post a copy of the code you are currently using?

John Big Booty, I wish I could, I would,
I"m a hack trying to make a simple darn database and I'm learning as I go.

I have no code.
I've only have used the macro functions, that I more or less transplanted from sample database templates.

What ever code I would have is just been given to me by boblarson. You can view it on the 2nd post of this thread.
What I have:
1 form that has detail info for a certain Item.

what I want to do is view the history from the form.. which I have done with a macro command.. from the action catalog.. using the openform action, using 'where Condition =' ="[Racquet ID]= &[ID]
That so far seems to be fine.

The 2nd thing I want to do is open a New form, that has transfered the ID part so I don't have to lookup the client and product again.

Again, I'm so pathetic at this time, I'm probably wasting everyone's time that looks at this. It seems like such a simple thing and something a database should do rather routinely. I"m not a code writer, but I do realize that this is a big time program and is very rich in it's content.
It would be wonderful If I could ever get this thing working.
Again, I do appreciate the time you take, the time boblarson takes into looking at this as well as everyone that will.

I can use a button to create a macro that
 
Have you changed the highlighted portion of Bob's code to reflect the reality of your DB?
Code:
DoCmd.OpenForm "FormNameHere", acViewNormal, DataMode:=acFormAdd, OpenArgs:=Me![B][COLOR="Red"]YourIDFieldNameHere[/COLOR][/B]
 
Have you changed the highlighted portion of Bob's code to reflect the reality of your DB?
Code:
DoCmd.OpenForm "FormNameHere", acViewNormal, DataMode:=acFormAdd, OpenArgs:=Me![B][COLOR=Red]YourIDFieldNameHere[/COLOR][/B]

Yes I did, My(YourIDFieldNameHere) is Client ID

Everything is hunkydory until the 'ID' part where it tells me..compile error, expected end of statement.

If I just remove the "ID" part of "Client ID", seems ok.. but of course that would be wrong since the field name is "Client ID"
 
OK you two..:D

I got it working! Woooohoooo!
Thanks to you guys, I do very very very much appreciate it!

I went with the product ID instead of the client ID and that works like a charm.

I am a happy guy..
THank you thank you thank you..

That is a nice little few bits of code..very very valuable, thanks again. Really.

Case closed!
 
if its a linked subform, and you have set the details in the mainform to manage the link - then you dont need to set the subform link to anything - access does it automagically.
 

Users who are viewing this thread

Back
Top Bottom