Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Datasheet Column Width

Status
Not open for further replies.

xlemosx

Programmer
Nov 25, 2010
8
CA
Hi,

The problem i'm having is with about 4 Queries datasheet column widths (not sure if i'm saying that in the most technical terms lol).

I have an access database that with VBA i have it creating a querydef. Each time the program is run the query is deleted and created again with the querydef object. Problem is on the same button click the queries are being deleted and created a report is being opened with the information from them.

in the report i have a subform/subreport showing the actually query and beside it a pie graph with the information. The pie graph is completely fine my problem is with the subreport. the subreport is showing the datasheet if im correct and everytime the query is deleted and created again the column width becomes default again and so it is cutting off some of the data.

so basically im wondering is there a way in my VBA after i create the Query to set the queries column width? or should i be doing this some other way?
 
Instead of deleting/recreating the QueryDef you may simply change its SQL property.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
how would i go about that?

right now everytime a button is clicked it deletes the query because in the code it creates the query. It cannot create the query unless it has been deleted.

The reason i need it to do this is because the user enters a date first and then the query is created based on the date they enter. The query has to be created, i can't just use an ADO Command because a report is using the query.

Now my VBA/Access knowledge isn't the best because i'm not really a VB/Access developer, i've just kind of been thrown into it. So if anyone has any suggestions or can tell me a better way of doing this it would be greatly appreciated.

I'm completely fine with the way my method is working right now except for the report side of things where i have field names being cut off because the column width is not wide enough...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top