Two research gaps in prior studies on knowledge sharing in virtual communities (VCs) are identified. First, prior studies have focused on VCs with no explicit rewards system, whereas VCs using a competition-based reward system (e.g., transactional VCs) is not explored. Second, prior studies have concentrated on the determinants of initial participation rather than sustained participation. In this study, considering that a social learning process is involved in sustained participation, task complexity and self-efficacy – two social learning factors – are proposed to moderate the relationship between motivations and sustained participation. A filed survey with 205 subjects in a transactional virtual community was conducted to test the research model. According to findings, extrinsic and intrinsic motivations significantly influence knowledge sharing intention. Negative interaction effect between extrinsic motivation and task complexity, as well as positive interaction effect between intrinsic motivation and self-efficacy, are observed as well. Implications and future research are discussed.