요약 정리

액세스 조회속성 4가지

함수바라기 2020. 12. 1. 06:48

 

유튜브 검색 = 함수바라기

 

** Filter : 조건에 맞는 레코드만 보여주고 나머지는 숨김. 폼에서 필터 해제 가능.

me.filter = "필드='" & 컨트롤(문자) & "'"

me. filteron = true

 

me.filter = "필드=" & 컨트롤(숫자)

me. filteron = true

 

me.filter = "필드=#" & 컨트롤(날짜) & "#"

me. filteron = true

 

me.filter = "필드 like '*" & 컨트롤(포함문자) & "*'"

me. filteron = true

 

 

 

** RecordsetClone : 전체 레코드 중 첫번째로 일치하는 값을 찾아서 커서 이동.

me.recordsetclone.findfirst "필드='" & 컨트롤 & "'"

me.bookmark = me.recordsetclone.bookmark

 

me.recordsetclone.findfirst "필드=" & 컨트롤(숫자)

me.bookmark = me.recordsetclone.bookmark

 

me.recordsetclone.findfirst "필드=#" & 컨트롤(날짜) & "#"

me.bookmark = me.recordsetclone.bookmark

 

me.recordsetclone.findfirst "필드 like '*" & 컨트롤(포함문자) & "*'"

me.bookmark = me.recordsetclone.bookmark

 

 


** RecordSource : 조건에 맞는 테이블의 정보를 찾아 레코드 원본으로 재설정.

                         한번 조회 후 폼에서 재조회 불가능. 재조회 필요 시 폼을 재실행 해야 함.

me.recordsource = "select 필드(*) from 테이블 where 필드='" & 컨트롤 & "'"

 

me.recordsource = "select 필드(*) from 테이블 where 필드=" & 컨트롤(숫자)

 

me.recordsource = "select 필드(*) from 테이블 where 필드=#" & 컨트롤(날짜) & "#"

 

me.recordsource = "select 필드(*) from 테이블 where 필드 like '*" & 컨트롤(포함문자) & "*'"

 

 

 

** ApplyFilter : 조건에 맞는 레코드만 보여주고 나머지는 숨김. 매크로로 작성 가능.

docmd.applyfilter , "필드='" & 컨트롤 & "'"

 

docmd.applyfilter , "필드=" & 컨트롤(숫자

 

docmd.applyfilter , "필드=#" & 컨트롤(날짜) & "#"

 

docmd.applyfilter , "필드 like '*" & 컨트롤(포함문자) & "*'"

반응형