At the end of my tether! Need help with populating a form from specific information (1 Viewer)

NickDenyer

Registered User.
Local time
Today, 19:36
Joined
May 2, 2012
Messages
57
Hello Access World Forums!

Thanks for hosting me, I've just signed up as this site has helped me out before :)

I need to pick your expert brains, and I apologise in advance if I've cross-posted, but my issues seems to be quite personalised so I assumed a new thread would be ok.

My basic issue is that I am trying to develop a form that has several combo boxes. These are: 'Barcode', 'Study', 'PI' and 'Status'. I want to select a code from, for example, 'Barcode', press a button called 'GO' (original, I know...) and be sent to another form that will then contain all the information associated with that code and that code only.

However, I am having issues setting this up. I understand forms, tables, and queries, but I am at a loss of how to build these together. I feel there is something in the background I am unaware of, and although populating a form from another seems to be a common problem, many forum posts I've read resolve somebody's issue, but mine never is :( I've scanned through many other posts on various forums and I've done everything it says but it still won't work :-(

So, my huge plea to you all is could somebody please walk me through ALL steps in great detail so I can achieve this, please? I have some understanding of VBA but I am an extremely fast learner, I just feel that I need an all-round lesson on this. By teaching me from the ground up, I feel I'll have a much better understanding than just filling small holes in my knowledge.

I cannot even begin to explain my depth of my gratitude for you all doing this for me!!!!! I will be eternally grateful!

Thanks in advance! N
 

RainLover

VIP From a land downunder
Local time
Tomorrow, 04:36
Joined
Jan 5, 2009
Messages
5,041
Create a Query that has all the information you need.

Add as Criteria the Result from the BarCode selection.

Open the query and you should see the result you need.

This being correct Create a Form with the Query as the Record Source.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:36
Joined
Feb 19, 2002
Messages
43,203
will the combos be used independently or together? If they are independent, you would need 4 "go" buttons unless you elected to use the BeforeUpdate event of each combo.
In the click event of the go barode button or in the BeforeUpdate event of the barcode combo -
Code:
    If Me.Dirty Then
        DoCmd.RunCommand acCmdSaveRecord
    End If
    DoCmd.OpenForm "frmBarcode", acNormal, , "BarcodeID = " & Me.cboBarcodeID
 

NickDenyer

Registered User.
Local time
Today, 19:36
Joined
May 2, 2012
Messages
57
will the combos be used independently or together? If they are independent, you would need 4 "go" buttons unless you elected to use the BeforeUpdate event of each combo[/code]

Hi Pat, I want four independent combo boxes, thank you :)

I've tried the code, and I'm getting the following error:

Private Sub Command88_Click()

Do I need to specify the name of the GO button?

Thanks
 
Last edited:

RainLover

VIP From a land downunder
Local time
Tomorrow, 04:36
Joined
Jan 5, 2009
Messages
5,041
Nick

In a year or two will you remember what Command 88 does. The answer most likely is NO.

So why not start a good habit NOW. Use Descriptive Names for everything. And when I say everything that is what I mean.

Every single Label, Text Box, Combo Box, Command Button and then every Table along with its Fields, Queries, Forms, Reports and Modules. And don't stop there.

Do a search on Naming Conventions for some help in this regard.

Go is just as bad as Command 86. Go where and what for. Try cmdOpenForm this is not only more descriptive it says that it is a Command Button that Opens a Form.

I could not recommend the lazy method of accepting the Access Defaults.
 

NickDenyer

Registered User.
Local time
Today, 19:36
Joined
May 2, 2012
Messages
57
Thanks Rain, I've took you're advice, and oddly (;D) enough, figured it out. Thanks!
 

RainLover

VIP From a land downunder
Local time
Tomorrow, 04:36
Joined
Jan 5, 2009
Messages
5,041
If you solved your problem it would of had little to do with my advice.

I simply wanted to make you a better programer.

Glad you listened. You would be surprised how many people think they can use garbage and get sensible results. They eventually find out the hard way.
 

Users who are viewing this thread

Top Bottom