Userform as a Query form


"Excel VBA Help"

 


Play Friv Now - Play Friv Games
Go Back   The Code Cage Forums > Microsoft Topics > Microsoft Excel Forum
Our Info Pages:-
The Code Cage - Microsoft Office help

Notices

Microsoft Excel Forum Members Post questions in this forum if they are related to using Microsoft Excel, this includes Worksheet Functions, Excel VBA Programming, Simple Macro Code & Charting, Excel formula etc.

 
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12th February 2017, 21:10
silvapereira's Avatar
silvapereira silvapereira is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some VBA experience
 
Join Date: Feb 2017
Location: Lisbon, Portugal
Posts: 28
Posts Per Day: 0.10
My Top Tip Count: 0
Thanks to others: 1
Thanked 0 Times in 0 Posts
Reputation: 10 (1) silvapereira is on a distinguished road
Portugal
Default Userform as a Query form
     Excel: VBA   


------ Register to get rid of these "In Post" ads! ------

Category: Excel: VBA   

Hi,

Some days ago I posted this, and I thought I already have solved the problem when I view this link: http://www.onlinepclearning.com/adva...-in-userforms/
I wanted to do a userform that serves for filter de data on the database (without going to the Worksheet) and it appears to me that the solution was on that link??!!

I did everything, as they said (as you can confirm on the attachment) but unfortunately it doesn't work and I can't figure out why?

The only field working is "Processo" and even that is not alright, because there are 2 records with the number 341927, and the filter only retrieves one record!!

The Clearme code is working very well.

Can anyone help me please
Thanks
Attached Files To view attachments in this forum your post count must be 2 or greater. You currently have 0 posts.


Last edited by silvapereira; 12th February 2017 at 21:14.


The Code Cage Advertisment
Advertisement
  #2  
Old 13th February 2017, 08:26
Ingolf's Avatar
Ingolf Ingolf is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Proficient with Excel
 
Join Date: Oct 2011
Location: KK
Posts: 22
Posts Per Day: 0.01
My Top Tip Count: 0
Thanks to others: 3
Thanked 2 Times in 2 Posts
Reputation: 60 (7) Ingolf will become famous soon enough
Peru
Default Re: Userform as a Query form

------ Register to get rid of these "In Post" ads! ------


Use this VBA code for filter date:

VBA CODE:
Sub FilterMe() 
    Sheets("DataBase").Range("A1:I92").AdvancedFilter Action:=xlFilterCopy, _ 
    CriteriaRange:=Sheets("FilterData").Range("C5:G6"), CopyToRange:=Sheets("FilterData").Range("C8:K8"), Unique:=False 
End Sub 



  #3  
Old 13th February 2017, 23:14
silvapereira's Avatar
silvapereira silvapereira is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some VBA experience
 
Join Date: Feb 2017
Location: Lisbon, Portugal
Posts: 28
Posts Per Day: 0.10
My Top Tip Count: 0
Thanks to others: 1
Thanked 0 Times in 0 Posts
Reputation: 10 (1) silvapereira is on a distinguished road
Portugal
Default Re: Userform as a Query form

------ Register to get rid of these "In Post" ads! ------


Hi Ingolf
Yes I Tried but doesn't work.
Thanks



The Code Cage Advertisment
Advertisement
  #4  
Old 13th February 2017, 23:29
Ingolf's Avatar
Ingolf Ingolf is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Proficient with Excel
 
Join Date: Oct 2011
Location: KK
Posts: 22
Posts Per Day: 0.01
My Top Tip Count: 0
Thanks to others: 3
Thanked 2 Times in 2 Posts
Reputation: 60 (7) Ingolf will become famous soon enough
Peru
Default Re: Userform as a Query form

------ Register to get rid of these "In Post" ads! ------


See attach.

It is better for you, to learn some function and then study VBA code.
Attached Files To view attachments in this forum your post count must be 2 or greater. You currently have 0 posts.



  #5  
Old 14th February 2017, 16:19
silvapereira's Avatar
silvapereira silvapereira is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some VBA experience
 
Join Date: Feb 2017
Location: Lisbon, Portugal
Posts: 28
Posts Per Day: 0.10
My Top Tip Count: 0
Thanks to others: 1
Thanked 0 Times in 0 Posts
Reputation: 10 (1) silvapereira is on a distinguished road
Portugal
Default Re: Userform as a Query form

------ Register to get rid of these "In Post" ads! ------


Ingolf
You're fantastic, and you're absolutely right, I am a dummie in what concerns with these things.
I don't want to be annouying but did you notice that the file you attached, with the fields Data Inicio (Start Date) and Data Fim (Finish Date), it doesn't work !!! doesn't filter the values inserted on that two fields?? Is it only with me??



  #6  
Old 14th February 2017, 17:20
Ingolf's Avatar
Ingolf Ingolf is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Proficient with Excel
 
Join Date: Oct 2011
Location: KK
Posts: 22
Posts Per Day: 0.01
My Top Tip Count: 0
Thanks to others: 3
Thanked 2 Times in 2 Posts
Reputation: 60 (7) Ingolf will become famous soon enough
Peru
Default Re: Userform as a Query form

------ Register to get rid of these "In Post" ads! ------


Ok, try this attach.
Attached Files To view attachments in this forum your post count must be 2 or greater. You currently have 0 posts.



The Code Cage Advertisment
Advertisement
  #7  
Old 14th February 2017, 17:56
silvapereira's Avatar
silvapereira silvapereira is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some VBA experience
 
Join Date: Feb 2017
Location: Lisbon, Portugal
Posts: 28
Posts Per Day: 0.10
My Top Tip Count: 0
Thanks to others: 1
Thanked 0 Times in 0 Posts
Reputation: 10 (1) silvapereira is on a distinguished road
Portugal
Default Re: Userform as a Query form

------ Register to get rid of these "In Post" ads! ------


Ingolf
Thnks for your reply.
Para Form 2 still have a problem as you can see.
In the sheet you send there's a filter for date and for categoria - as you can see some rows are hidden, because you filtered the date (I think).
If you click Limpar (Clear) it works ok , but remained the same rows hidden.
If then you try to filter, say for instance Entidade-Advancecare, nothing appears, I think because of two things (don't forget i'm a rockye, I think but i'm not sure).
1. It should only Filter the Date when fields (start date and finish date) are filled.
2. The Limpar button should have a code to withdraw the filter to the Date also??

I don't know if is this who happens, and i don't know if there are codes for this?
Can you help!
Thank you very much



  #8  
Old 20th February 2017, 02:22
silvapereira's Avatar
silvapereira silvapereira is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some VBA experience
 
Join Date: Feb 2017
Location: Lisbon, Portugal
Posts: 28
Posts Per Day: 0.10
My Top Tip Count: 0
Thanks to others: 1
Thanked 0 Times in 0 Posts
Reputation: 10 (1) silvapereira is on a distinguished road
Portugal
Default Re: Userform as a Query form

------ Register to get rid of these "In Post" ads! ------


Ingolf,
As you can see i'm trying to do the work, and learn some features about Vba.
I manage to alter the code you so kindly send to me last time, and in the worksheet it Works nice and perfectly.

But there's still a problem. I want the user navegates from form to form without seeing the worksheets, and the problem is that with the userform filter, when I insert the start date (Data Inicio) and finish date (Data fim) the filter does'nt work.

I notice that one of the errors is because (DataFim) Finish Date retrieves to the sheet values in format "mm/dd/YYYY) ?? I don't know why? because in the code they have same format ("dd/mm/yyyy"). But even when I insert the date mm/dd/yyyy, I can see that in the worsheet everything goes well, but the form doesn't filter correctly and the listbox presents all the records.

Can you hellp me with this??
thanks
Attached Files To view attachments in this forum your post count must be 2 or greater. You currently have 0 posts.



  #9  
Old 24th February 2017, 00:20
silvapereira's Avatar
silvapereira silvapereira is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some VBA experience
 
Join Date: Feb 2017
Location: Lisbon, Portugal
Posts: 28
Posts Per Day: 0.10
My Top Tip Count: 0
Thanks to others: 1
Thanked 0 Times in 0 Posts
Reputation: 10 (1) silvapereira is on a distinguished road
Portugal
Default Re: Userform as a Query form

------ Register to get rid of these "In Post" ads! ------


Please, can someone help me with this problema ..
Thanks



The Code Cage Advertisment
Advertisement
  #10  
Old 26th February 2017, 20:34
silvapereira's Avatar
silvapereira silvapereira is offline
Junior Member
MS Office Version: Ms Office 2013
MS Office Skill Level: Some VBA experience
 
Join Date: Feb 2017
Location: Lisbon, Portugal
Posts: 28
Posts Per Day: 0.10
My Top Tip Count: 0
Thanks to others: 1
Thanked 0 Times in 0 Posts
Reputation: 10 (1) silvapereira is on a distinguished road
Portugal
Default Re: Userform as a Query form

------ Register to get rid of these "In Post" ads! ------


well guys !!
thanks anyway for not respond to my dificulties
It give me some work and some learning, but i solved the problema copying the data to another sheet (only the ones in visible rows) and it Works very well.

thanks



The Code Cage Advertisment
Advertisement
 
The Code Cage at Facebookhe Code Cage at Twitter


Tags
form, query, userform

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

The Code Cage Affilliates



http://www.thecodecage.com/forumz tested by McAfee Security http://www.thecodecage.com/forumz tested by McAfee Security

All times are GMT +1. The time now is 09:46.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Template-Modifications by TMS
No part of this board, functionality or creatives may be copied or reproduced either in part or full without the express permission of The Code Cage Team.
Copyright ©2008 - , Simon lloyd.
We are not associated with nor employed by Microsoft in any way, we simply provide resources!
All MS office icons are registered trademarks of the application they represent and are used with permission from Microsoft
UA-8135493-1
Cultural Forum | Study at Malaysian University
X vBulletin 3.8.7 Debug Information
  • Page Generation 0.20831 seconds
  • Memory Usage 6,596KB
  • Queries Executed 16 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footerEnd
  • (1)ad_footerStart
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_headerEnd
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_leftcolumn_code
  • (1)ad_navbar_below
  • (5)ad_postbit_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (10)helpful_answers
  • (1)helpfulanswers_javascript
  • (1)navbar
  • (3)navbar_link
  • (3)navbar_noticebit
  • (52)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (4)postbit_attachment
  • (10)postbit_ctoptip
  • (10)postbit_onlinestatus
  • (10)postbit_reputation
  • (10)postbit_wrapper
  • (1)showthread_changepostsowner_link
  • (1)showthread_extra_fields
  • (1)showthread_quickreply_mrgdp
  • (1)showthread_reason_popup
  • (1)spacer_close
  • (1)spacer_open
  • (1)su_form
  • (3)tagbit
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_datastore.php
  • ./includes/class_hook.php
  • ./awcoding/plugins/awc.php
  • ./awcoding/plugins/ds.php
  • ./awcoding/plugins/ss.php
  • ./includes/functions_notice.php
  • ./mobiquo/smartbanner.php
  • ./mobiquo/include/classTTConnection.php
  • ./mobiquo/smartbanner/head.inc.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/vbatags.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php
  • ./includes/functions_misc.php 

Hooks Called:
  • init_startup
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_check_criteria
  • notices_noticebit
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • helpfulanswers_showthreadorpost
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • helpfulanswers_show_normal
  • reputation_power
  • reputation_image
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • error_fetch
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete