RE: passing data to new form using open args



What I'm trying to do is recreate (as best as possible) a web front end in
access forms. I don't know much about DAPs yet so we're going this route.
I'm trying to make it look as close as possible to the current product.

Maybe I should just set the form up with more combos, set the bound column
to the UID (which is what needs to be updated/added in to the table) and
display column 2 with concatenated data. Seems to be the best route now as
I've been stuck on this for weeks.

"Klatuu" wrote:

You want the entire record in the combo? why?
A record is always selected. When you open a form, the first record in the
form's recordset is always displayed.

I guess I don't understand what it is you are actually trying to do.

"fsuds" wrote:

Sorry, guess I should have also put the Forms OnLoad Event

Me.RecordSource = Me.OpenArgs

One question. If I put my SQL into the row source property, that will pull
the data but will only display the bound column when a record is selected,
correct? I know that this sounds crazy but I was hoping to display all of
the information in the combo.

Thanks for the response and help so far.

"Klatuu" wrote:

The first problem you are having is how you are using the OpenArgs argument.
The form receiving the OpenARgs does nothing with it unless you code for it.
That is usually done in the Form's Open event. See VBA Help for good info on
how you use it.

If the SQL you are trying to send to the form is the data you want for your
form, then you should make that the Record Source for the form. And, if you
are trying to filter what data is presented in the form. Then the usual
method is to construct a WHERE Clause without the word Where and use that in
the OpenForm method as the Where argument. Again, look in VBA Help for info
on OpenForm.

As to the SQL you have for your combo boxes. Take out the commas. Set your
Row Source type to Table/Query and put the SQL in the Row Source property.
You will have to make some adjustments to your combos to set the correct
number of columns, the bound column, and the column width properties.

Once you get this much going, post back with what is and is not working so
we can take it from there.
"fsuds" wrote:

I posted this in the forms forum but have yet to receive a response. I
figured maybe I could try this one. Thanks for any help.

----------------------------------------------------

I'm having trouble figuring out what I need to do here. Basically, I
want to pull data from several different tables and send them to a form
using open args. However, the form that is being fed need to have
certain columns of data concatenated and displayed in combo boxes. The text
boxes receive and display the correct data but my combo boxes remain blank.

Here is the code from my search form to feed the rental edit:

sSQL = "Select RENTAL.[RID], RENTAL.[EVENTID], EVENT.[NAME]," & _
" EVENT.[FILENUMBER], RENTAL.[RENTALDATE], RENTALITEM.[RENTALID],"
& _
" RENTAL.[RENTALITEM], RENTAL.[RENTALTYPE]," & _
" RENTAL.[PRICEPERUNIT], RENTAL.[QUANTITY]" & _
" FROM RENTALITEM, RENTAL, EVENT" & _
" WHERE forms![frmRentalSearch].[RID] = RENTAL.[RID]"


DoCmd.OpenForm "frmEditRental", acNormal, OpenArgs:=sSQL

Here is the code for my 2 combo boxes on the edit form:

frmEditRental


cmbEVENT: SELECT ([RENTAL].[EventID]) & ", " & nz([EVENT].[Name]) & ",
" & nz([EVENT].[FILENUMBER]) AS Expr1
FROM EVENT INNER JOIN RENTAL ON [EVENT].[EVENTID]=[RENTAL].[EventID];


cmbPrice: SELECT [RENTALITEM].[RentalID], ([RENTAL.RENTALITEM]) & ", "
& ([RENTAL].[RENTALTYPE]) & ", " & ([RENTAL].[PRICEPERUNIT]) AS Expr1
FROM RENTAL INNER JOIN RENTALITEM ON
[RENTAL].[RentalID]=[RENTALITEM].[RentalID];


txtRentalDate: RentalDate
txtRID: RID
txtQuantity: Quantity


I also have a similar form setup for data entry and can select data through
the combo box but when I save the record, not all of the information is saved
in the table.

I'm absolutley stuck. All help is greatly appreciated.

.



Relevant Pages

  • RE: passing data to new form using open args
    ... the data but will only display the bound column when a record is selected, ... look in VBA Help for info ... As to the SQL you have for your combo boxes. ... FROM RENTAL INNER JOIN RENTALITEM ON ...
    (microsoft.public.access.formscoding)
  • RE: passing data to new form using open args
    ... The first problem you are having is how you are using the OpenArgs argument. ... look in VBA Help for info ... As to the SQL you have for your combo boxes. ... FROM RENTAL INNER JOIN RENTALITEM ON ...
    (microsoft.public.access.formscoding)
  • RE: passing data to new form using open args
    ... The form is set up with multiple combos and text boxes I was just trying to ... the data but will only display the bound column when a record is selected, ... As to the SQL you have for your combo boxes. ... FROM RENTAL INNER JOIN RENTALITEM ON ...
    (microsoft.public.access.formscoding)
  • Re: error 3048 - Cannot open any more databases
    ... The combo that uses the callback function as its RowSourceType will still be able to display the desired data. ... What happens is that you load the static array one, and then it calls the callback function whenever it needs a value. ... I am using these combo boxes not only as a way of selecting a ... > the same subform, just inserted 48 times. ...
    (microsoft.public.access.formscoding)
  • Re: Urgent: Need Shipping Box for Sun 24.1" LCD Display
    ... I made the original posting) and they weren't able to help. ... Luckily there was no damage to the display inside the box. ... be sure to save at least one of these boxes for future shipments. ... You can try a company called Heritage Paper (used to be called ...
    (comp.sys.sun.admin)

Quantcast