vba - Access: cannot move to next record with the code -


private sub btn_next_click() 'creating connection database dim strsql string dim rs dao.recordset  strsql = "select * tbl_author" set rs = currentdb.openrecordset(strsql)      if not rs.bof , not rs.eof         while (not rs.eof)             me.txtid = rs.fields("author_id")             me.txtfname = rs.fields("afirst_name")             me.txtlname = rs.fields("alast_name")             me.txtaddress = rs.fields("address")             me.txteaddress = rs.fields("email_address")             me.txtmnum = rs.fields("mobile_number")             me.txtpnum = rs.fields("phone_number")             me.cmbstatus = rs.fields("status")             rs.movenext         wend     end if     rs.close end sub 

found answer. wrote query based on current record displayed in form, no need of loop, every time click on next, gets next value database , post in textboxes.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -