Multiple fields ComboBox - Not works for output

User avatar
sistemaPR
2StarLounger
Posts: 119
Joined: 01 Jul 2013, 14:08

Multiple fields ComboBox - Not works for output

Post by sistemaPR »

Database22.zip
Now,

1.) there are is a combobox it has 4 fields but is bound to column2, i am including a small db, the objective is to send the query data to an excel file. Via an access macro = Output to -> excel. etc. but in the form I want to capture additional information like first auditor1, first auditor2, 2ndR Auditor, but each auditor has his own title and credentials, I want to create the query that includes this fields (Name, Title and Credentials). The problem is that the title for the first auditor in the excel file are blanks .. the title should be ComboFirstAuditor1.column(3). I cant see whats is wrong,

2.) I also wish to change the directory(To save) to the folder in which the application is, that is why I use the period, but and the time to save the file it written in another place. I think is the MSoffice folder . Right now it points to >>> --- Windows-->System32. maybe you have to looks for tha output file in there and I dont know why.

3.) and last there is a form that displays DONE at the end , them I have a command inside the macro to close the form and doesnt close it ...
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78626
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Multiple fields ComboBox - Not works for output

Post by HansV »

1) In a query, you cannot refer to other columns than the bound column of a combo box or list box. As a workaround, create an invisible text box on the form that displays the title, and refer to the text box in the query.

2) I don't know how to do this in a macro. In VBA, you can get the path of the active database using CurrentProject.Path.

3) You open Form1_Done with WindowMode set to Dialog. Because of that, code execution pauses until the form is closed, so the CloseWindow action is never executed. To get around this, close the form from its own Form_Timer event.

See the attached version.
Database22.zip
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
sistemaPR
2StarLounger
Posts: 119
Joined: 01 Jul 2013, 14:08

Re: Multiple fields ComboBox - Not works for output

Post by sistemaPR »

One million Thanks ...