0
votes

Hy all ,

I'm making an access 2013 databases application , for my work place with the scope to generate automatically some documents based on some combo box selections.

So in order , to be much more specific , the main form have :

  • one combo-box selection for truck number (cboNr_Auto) which reads from table "Advanced Conditional List" and fill auto text boxes for displaying name of driver , license number , etc... ( working well with afterUpdate event)
  • one combo-box selection for code of trash (cboCod_Deseu) which reads from table "Categorie_Deseuri" and display the name of the trash in text-box "txtDenumire_Deseu" ...(not working)
  • date pickers for loading and unloading dates- working well
  • text box for manual entry of weight - working well

My questions are next :

  • how can i make my combo-box selection "cboCod_Deseu" to display values in text-box from the table "Categorie_Deseuri" in my main form ?
  • how can i generate an report based on my combo-box selections , date pickers and manual entry for the weight field via a pushbutton?

Thanks

1

1 Answers

1
votes

let say you have combobox with a recodsource and this recodsource returns 3 column.

Now if you want to set the textbox based on the selcted value of combobox than you can set the textbox controlsurce as below.

=[Combo0].[column](1)

'Combo0' is the name of combobox.

For report based on the different criteria.

first of all create a query for the report and change this query based on your criteria. Below is the small example how you can acheive this.

Dim query_1 as string

query_1 = "Select * from Table1 where DATE = #yourdate#"

CurrentDb.QueryDefs("Report_Query").sql = query_1 

Report_Query is the name of the query which you have saved earlier. open the report based on this.